|
3#
楼主 |
发表于 2011-8-12 08:29:11
|
只看该作者
自己解答7z
以下仍是加入的方法,相反的方法便可去除.
做一个AA.CMD,内容如下:
SET TP=%CD%
rem 第一部分
rem 关联7z右键,注意更改路径
set TP= D:\Tools\GreenSoft\0PE工具\7-Zip
reg add "HKU\.DEFAULT\Software\7-ZIP" /f /v "Lang" /t REG_SZ /d "zh-cn"
rem reg add "HKU\.DEFAULT\SessionInformation" /f /v "ProgramCount" /t REG_DWORD /d 4
reg add "HKU\.DEFAULT\Software\7-ZIP\Options" /f /v "CascadedMenu" /t REG_DWORD /d 1
reg add "HKU\.DEFAULT\Software\7-ZIP\Options" /f /v "ContextMenu" /t REG_DWORD /d 805
rem 4919显示全部右键菜单.807显示ZIP项,805显示主要项
reg add "HKU\.DEFAULT\Software\7-ZIP\Options" /f /v "WorkDirType" /t REG_DWORD /d 0
reg add "HKU\.DEFAULT\Software\7-ZIP\Options" /f /v "WorkDirPath" /t REG_SZ /d ""
reg add "HKU\.DEFAULT\Software\7-ZIP\Options" /f /v "TempRemovableOnly" /t REG_DWORD /d 1
rem 以下七项在天意PE3中发现存在.
reg add "HKLM\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\7-ZIP" /f /ve /t REG_SZ /d "{23170F69-40C1-278A-1000-000100020000}"
reg add "HKLM\SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}" /f /ve /t REG_SZ /d "7-Zip Shell Extension"
reg add "HKLM\SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32" /f /ve /t REG_SZ /d "%TP%\7-zip.dll"
reg add "HKLM\SOFTWARE\Classes\CLSID\{23170F69-40C1-278A-1000-000100020000}\InprocServer32" /f /v "ThreadingModel" /t REG_SZ /d "Apartment"
reg add "HKLM\SOFTWARE\Classes\Directory\shellex\DragDropHandlers\7-ZIP" /f /ve /t REG_SZ /d "{23170F69-40C1-278A-1000-000100020000}"
reg add "HKLM\SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers\7-ZIP" /f /ve /t REG_SZ /d "{23170F69-40C1-278A-1000-000100020000}"
reg add "HKLM\SOFTWARE\Classes\Drive\shellex\DragDropHandlers\7-ZIP" /f /ve /t REG_SZ /d "{23170F69-40C1-278A-1000-000100020000}"
rem 第二部分
rem 关联7z类型,右键功能已加入注册表
reg add "HKLM\SOFTWARE\Classes\.7z" /f /ve /t REG_SZ /d "7-Zip.7z"
reg add "HKLM\SOFTWARE\Classes\.arj" /f /ve /t REG_SZ /d "7-Zip.arj"
reg add "HKLM\SOFTWARE\Classes\.cab" /f /ve /t REG_SZ /d "7-Zip.cab"
reg add "HKLM\SOFTWARE\Classes\.rar" /f /ve /t REG_SZ /d "7-Zip.rar"
reg add "HKLM\SOFTWARE\Classes\.vhd" /f /ve /t REG_SZ /d "7-Zip.vhd"
reg add "HKLM\SOFTWARE\Classes\.zip" /f /ve /t REG_SZ /d "7-Zip.zip"
reg add "HKLM\SOFTWARE\Classes\.wim" /f /ve /t REG_SZ /d "7-Zip.wim"
reg add "HKLM\SOFTWARE\Classes\7-Zip.7z" /f /ve /t REG_SZ /d ".7z 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.7z\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,0"
reg add "HKLM\SOFTWARE\Classes\7-Zip.7z\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.7z\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.7z\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\7-Zip.arj" /f /ve /t REG_SZ /d ".arj 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.arj\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,4"
reg add "HKLM\SOFTWARE\Classes\7-Zip.arj\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.arj\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.arj\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\7-Zip.cab" /f /ve /t REG_SZ /d ".cab 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.cab\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,7"
reg add "HKLM\SOFTWARE\Classes\7-Zip.cab\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.cab\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.cab\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\7-Zip.rar" /f /ve /t REG_SZ /d ".rar 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.rar\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,3"
reg add "HKLM\SOFTWARE\Classes\7-Zip.rar\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.rar\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.rar\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\7-Zip.vhd" /f /ve /t REG_SZ /d ".vhd 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.vhd\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,20"
reg add "HKLM\SOFTWARE\Classes\7-Zip.vhd\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.vhd\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.vhd\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\7-Zip.zip" /f /ve /t REG_SZ /d ".zip 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.zip\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,1"
reg add "HKLM\SOFTWARE\Classes\7-Zip.zip\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.zip\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.zip\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\7-Zip.wim" /f /ve /t REG_SZ /d ".wim 压缩文件"
reg add "HKLM\SOFTWARE\Classes\7-Zip.wim\DefaultIcon" /f /ve /t REG_SZ /d "%TP%\7-Zip\7z.dll,1"
reg add "HKLM\SOFTWARE\Classes\7-Zip.wim\shell" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.wim\shell\open" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\7-Zip.wim\shell\open\command" /f /ve /t REG_SZ /d "\"%TP%\7-Zip\7zFM.exe\" \"%%1\""
:END
EXIT
(不少PE3的注册表加入了右键功能,但类型注册外置)
第三部分,导入类型直接加入注册表
以下内容是通过修改加载注册表,想必速度为快一点.
将system32\config\Software模块加载成_Software,将以下内容作成AA.reg导入即可,其它类型同理:
获取注册表方法是:先在无7z的PE上运行7zFM.exe,修改所需的注册类型和右键菜单显示项目,然后到注册表HKEY_LOCAL_MACHINE\Software\Classes下导出这些项目,将所有导出项目合并,并将Software改成你加载时的名称,导入即成.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.7z]
@=".7z 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.7z\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,0"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.7z\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.7z\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.7z\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\_Software\Classes\.7z]
@="7-Zip.7z"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.arj]
@=".arj 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.arj\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,4"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.arj\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.arj\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.arj\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\_Software\Classes\.arj]
@="7-Zip.arj"
[HKEY_LOCAL_MACHINE\_Software\Classes\.cab]
@="7-Zip.cab"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.cab]
@=".cab 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.cab\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,7"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.cab\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.cab\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.cab\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\_Software\Classes\.rar]
@="7-Zip.rar"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.rar]
@=".rar 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.rar\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,3"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.rar\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.rar\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.rar\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\_Software\Classes\.vhd]
@="7-Zip.vhd"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.vhd]
@=".vhd 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.vhd\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,20"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.vhd\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.vhd\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.vhd\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\_Software\Classes\.wim]
@="7-Zip.wim"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.wim]
@=".wim 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.wim\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,15"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.wim\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.wim\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.wim\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\_Software\Classes\.zip]
@="7-Zip.zip"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.zip]
@=".zip 压缩文件"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.zip\DefaultIcon]
@="X:\\Program Files\\7-Zip\\7z.dll,1"
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.zip\shell]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.zip\shell\open]
@=""
[HKEY_LOCAL_MACHINE\_Software\Classes\7-Zip.zip\shell\open\command]
@="\"X:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\"" |
|