Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
tuto:gestion_de_parc:ocs:7zip [02/02/2010 12:46]
dani
tuto:gestion_de_parc:ocs:7zip [13/07/2012 10:07] (Version actuelle)
dani Page moved and renamed from ocs_7zip to tuto:gestion_de_parc:ocs:7zip
Ligne 7: Ligne 7:
 Voici les fichiers qu'il comprend et leur description: Voici les fichiers qu'il comprend et leur description:
  
-{{:gestion_de_parc:screenhunter_09_oct._26_16.34.gif|}}+  ***cmdow.exe**: C'est un tout petit utilitaire pour masquer la fenêtre DOS. On peut le trouver icihttp://www.commandline.co.uk/cmdow/
  
-**7z.exe**: C’est le fichier d’installation de 7zip pour Windows XP. +  ***7z.exe**: C’est le fichier d’installation de 7zip pour Windows XP. On peut télécharger la dernière version sur cette page: http://www.7-zip.org/. **Il faut ensuite renommer le fichier en 7z.exe**
-On peut télécharger la dernière version sur cette page: http://www.7-zip.org/ +
-Il faut ensuite renommer le fichier en 7z.exe+
  
-**install.bat**: C’est lui qui sera exécuté par OCS, voici les lignes qu'il contient et leurs fonctions :+  ***install.bat**: C’est lui qui sera exécuté par OCS, voici les lignes qu'il contient:
  
 <code> <code>
 cmdow.exe @ /HID cmdow.exe @ /HID
-wscript.exe //B //Nologo install.vbs +7z.exe /S 
-</code>+@echo off
  
-**install.vbs**: C'est lui qui s'occupe de l'install et de l'association des fichiers: +SETLOCAL 
-<code> +SET SC=HKLM\SOFTWARE\Classes 
-on error resume next +SET Extn=001 7z arj bz2 cab cpio deb gz iso lzh nsis rar rpm tar z zip tgz tbz tbz2 
-Set objShell CreateObject("WScript.Shell"+FOR %%j IN (%Extn%DO 
-  +    REG ADD %SC%\.%%j /VE /D "7-Zip.%%j/F 
-installpath = "C:\Program Files\7-Zip\" +    REG ADD %SC%\7-Zip.%%j /VE /D "7z Archive" /F 
-install "7z.exe /S /D=" &amp; chr(34) &amp; installpath &amp; chr(34) +    REG ADD %SC%\7-Zip.%%j\DefaultIcon /VE /D "\"%SYSTEMROOT%\System32\zipfldr.dll\"" /F 
-  +    REG ADD %SC%\7-Zip.%%j\shell\open\command /VE /D "\"%PROGRAMFILES%\7-Zip\7zFM.exe\\"%%1\"" /F 
-'run the install command +
-returned = objShell.run(install,1,true) +ENDLOCAL 
-  + 
-'continue to file association of completed install +exit
-if returned = 0 then +
-  +
- 'specify the extensions to register with the program +
- extensionlist = ".7z,.iso,.zip,.rar,.ace,.lzma,.bz2,.bzip2,.tbz,.tbz2,.tar,.gz,.gzip,.tgz,.rpm,.deb,.dmg,.cab" +
-  +
- 'create an array with the extenstions from above +
- extensionarray = split(extensionlist,",",-1,1) +
- err.clear +
-  +
- 'for each extension do +
- For Each CurrentExt In extensionarray +
- 'delete current file handler +
- deletefiletype(CurrentExt) +
- 'add 7zip association +
- objShell.RegWrite "HKCR\" &amp; CurrentExt &amp; "\" ,"7-Zip.7z+
- Next +
-  +
- 'now create the actuall association +
- objShell.RegWrite "HKCR\7-Zip.7z\" , "7z Archive" +
-  +
- 'create icon +
- iconpath = installpath &amp; "7z.dll,0" +
- objShell.RegWrite "HKCR\7-Zip.7z\DefaultIcon\" , iconpath +
-  +
- 'create shell action +
- opencmd = chr(34) &amp; installpath &amp; "7zFM.exe&amp; chr(34) &amp; " " &amp; chr(34) &amp; "%1" &amp; chr(34) +
- objShell.RegWrite "HKCR\7-Zip.7z\shell\open\command\", opencmd +
-  +
- 'check if err.number has been set, if so return failed +
- if err.number = 0 then +
- exitcode = 0 +
- else +
- exitcode = 1 +
- end if +
-else +
- exitcode = 1 +
-end if +
-  +
-'exit and return code +
-wscript.quit(exitcode) +
-  +
-sub deletefiletype(filetype) +
- 'set variables for registry access with WMI +
- Const HKEY_CLASSES_ROOT = &amp;H80000000 +
- computer = "." +
-  +
- 'create connection to registry +
- Set objReg = GetObject("winmgmts:\\" &amp; computer &amp; "\root\default:StdRegProv") +
-  +
- 'read the key that exists +
- objReg.EnumKey HKEY_CLASSES_ROOT,filetype,SubKeyArray +
-  +
- 'if key has subkeys then recurse +
- If IsArray(SubKeyArrayThen +
- For Each SubKey In SubKeyArray +
- deletefiletype filetype &amp; "\" &amp; subkey +
- Next +
- End If +
-  +
- 'otherwise delete the key +
- objReg.DeleteKey HKEY_CLASSES_ROOT,filetype +
-end sub +
-  +
-wscript.quit+
 </code> </code>
 +
 +
  • tuto/gestion_de_parc/ocs/7zip.1265111200.txt.gz
  • Dernière modification: 02/02/2010 12:46
  • de dani