Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
tuto:gestion_de_parc:ocs:7zip [02/02/2010 12:46] dani |
tuto:gestion_de_parc:ocs:7zip [23/06/2010 09:14] dani Page moved from gestion_de_parc:ocs_7zip to 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**: |
- | **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:// |
- | On peut télécharger la dernière version sur cette page: http:// | + | |
- | Il faut ensuite renommer le fichier en 7z.exe | + | |
- | **install.bat**: | + | ***install.bat**: |
< | < | ||
cmdow.exe @ /HID | cmdow.exe @ /HID | ||
- | wscript.exe //B //Nologo install.vbs | + | 7z.exe /S |
- | </ | + | @echo off |
- | **install.vbs**: | + | SETLOCAL |
- | < | + | 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 | + | FOR %%j IN (%Extn%) DO ( |
- | + | REG ADD %SC%\.%%j /VE /D " | |
- | installpath = "C:\Program Files\7-Zip\" | + | REG ADD %SC%\7-Zip.%%j /VE /D "7z Archive" |
- | install | + | REG ADD %SC%\7-Zip.%%j\DefaultIcon |
- | + | REG ADD %SC%\7-Zip.%%j\shell\open\command | |
- | 'run the install command | + | ) |
- | returned = objShell.run(install, | + | ENDLOCAL |
- | + | ||
- | ' | + | exit |
- | if returned = 0 then | + | |
- | + | ||
- | ' | + | |
- | extensionlist = ".7z,.iso,.zip, | + | |
- | + | ||
- | ' | + | |
- | extensionarray = split(extensionlist,",", | + | |
- | err.clear | + | |
- | + | ||
- | 'for each extension do | + | |
- | For Each CurrentExt In extensionarray | + | |
- | ' | + | |
- | deletefiletype(CurrentExt) | + | |
- | 'add 7zip association | + | |
- | objShell.RegWrite " | + | |
- | Next | + | |
- | + | ||
- | 'now create the actuall association | + | |
- | objShell.RegWrite "HKCR\7-Zip.7z\" , "7z Archive" | + | |
- | + | ||
- | ' | + | |
- | iconpath = installpath & " | + | |
- | objShell.RegWrite "HKCR\7-Zip.7z\DefaultIcon\" | + | |
- | + | ||
- | ' | + | |
- | opencmd = chr(34) & installpath & "7zFM.exe" | + | |
- | objShell.RegWrite "HKCR\7-Zip.7z\shell\open\command\" | + | |
- | + | ||
- | ' | + | |
- | 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 = & | + | |
- | computer = "." | + | |
- | + | ||
- | ' | + | |
- | Set objReg = GetObject(" | + | |
- | + | ||
- | 'read the key that exists | + | |
- | objReg.EnumKey HKEY_CLASSES_ROOT, | + | |
- | + | ||
- | 'if key has subkeys then recurse | + | |
- | If IsArray(SubKeyArray) Then | + | |
- | For Each SubKey In SubKeyArray | + | |
- | deletefiletype filetype & " | + | |
- | Next | + | |
- | End If | + | |
- | + | ||
- | ' | + | |
- | objReg.DeleteKey HKEY_CLASSES_ROOT, | + | |
- | end sub | + | |
- | + | ||
- | wscript.quit | + | |
</ | </ | ||
+ | |||
+ |