Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe]
@="E:\\PROGRA~1\\WinRAR\\WinRAR.exe"
"Path"="E:\\PROGRA~1\\WinRAR"
[HKEY_CLASSES_ROOT\CLSID\{B41DB860-64E4-11D2-9906-E49FADC173CA}]
@="WinRAR"
[HKEY_CLASSES_ROOT\CLSID\{B41DB860-64E4-11D2-9906-E49FADC173CA}\InProcServer32]
@="E:\\PROGRA~1\\WinRAR\\rarext.dll"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\WinRAR]
@="RAR 压缩文件"
[HKEY_CLASSES_ROOT\WinRAR\DefaultIcon]
@="E:\\PROGRA~1\\WinRAR\\WinRAR.exe,0"
[HKEY_CLASSES_ROOT\WinRAR\shell]
[HKEY_CLASSES_ROOT\WinRAR\shell\open\command]
@="\"E:\\PROGRA~1\\WinRAR\\WinRAR.exe\" \"%1\""
[HKEY_CLASSES_ROOT\WinRAR\shellex]
[HKEY_CLASSES_ROOT\WinRAR\shellex\ContextMenuHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR\shellex\ContextMenuHandlers\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR\shellex\DropHandler]
@="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\WinRAR\shellex\PropertySheetHandlers]
[HKEY_CLASSES_ROOT\WinRAR\shellex\PropertySheetHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR\shellex\PropertySheetHandlers\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR.REV]
@="RAR 恢复卷"
[HKEY_CLASSES_ROOT\WinRAR.REV\DefaultIcon]
@="E:\\PROGRA~1\\WinRAR\\WinRAR.exe,1"
[HKEY_CLASSES_ROOT\WinRAR.REV\shell]
[HKEY_CLASSES_ROOT\WinRAR.REV\shell\open\command]
@="\"E:\\PROGRA~1\\WinRAR\\WinRAR.exe\" \"%1\""
[HKEY_CLASSES_ROOT\WinRAR.ZIP]
@="ZIP 压缩文件"
[HKEY_CLASSES_ROOT\WinRAR.ZIP\DefaultIcon]
@="E:\\PROGRA~1\\WinRAR\\WinRAR.exe,0"
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shell]
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shell\open\command]
@="\"E:\\PROGRA~1\\WinRAR\\WinRAR.exe\" \"%1\""
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex]
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex\ContextMenuHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex\ContextMenuHandlers\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex\DropHandler]
@="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex\PropertySheetHandlers]
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex\PropertySheetHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WinRAR.ZIP\shellex\PropertySheetHandlers\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@="WinRAR"
[HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{B41DB860-8EE4-11D2-9906-E49FADC173CA}\InProcServer32]
@="E:\\PROGRA~1\\WinRAR\\rarext32.dll"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\WinRAR]
@="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\WinRAR32]
@="{B41DB860-8EE4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\Drive\ShellEx\DragDropHandlers]
[HKEY_CLASSES_ROOT\Drive\ShellEx\DragDropHandlers\WinRAR]
@="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\Drive\ShellEx\DragDropHandlers\WinRAR32]
@="{B41DB860-8EE4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers]
[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\exefile\shellex\PropertySheetHandlers\{B41DB860-8EE4-11D2-9906-E49FADC173CA}]
@=""
[HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\WinRAR]
@="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\Folder\shellex\ContextMenuHandlers\WinRAR32]
@="{B41DB860-8EE4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\Folder\shellex\DragDropHandlers]
[HKEY_CLASSES_ROOT\Folder\shellex\DragDropHandlers\WinRAR]
@="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
[HKEY_CLASSES_ROOT\Folder\shellex\DragDropHandlers\WinRAR32]
@="{B41DB860-8EE4-11D2-9906-E49FADC173CA}"
[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]
"WinRAR"="Software\\WinRAR\\Capabilities"
;格式
[HKEY_CLASSES_ROOT\.7z]
@="WinRAR"
[HKEY_CLASSES_ROOT\.cab]
@="WinRAR"
[HKEY_CLASSES_ROOT\.jar]
@="WinRAR"
[HKEY_CLASSES_ROOT\.rar]
@="WinRAR"
[HKEY_CLASSES_ROOT\.tar]
@="WinRAR"
[HKEY_CLASSES_ROOT\.zip]
@="WinRAR.ZIP"
[HKEY_CLASSES_ROOT\.r00]
@="WinRAR"
[HKEY_CURRENT_USER\Software\WinRAR\Setup\.7z]
"Set"=dword:00000001
"Exist"=dword:00000000
"Type"=""
"Content"=""
"ShellNew"=""
[HKEY_CURRENT_USER\Software\WinRAR\Setup\.cab]
"Set"=dword:00000001
"Exist"=dword:00000001
"Type"="CABFolder"
"Content"=""
"ShellNew"=""
[HKEY_CURRENT_USER\Software\WinRAR\Setup\.jar]
"Set"=dword:00000001
"Exist"=dword:00000000
"Type"=""
"Content"=""
"ShellNew"=""
[HKEY_CURRENT_USER\Software\WinRAR\Setup\.rar]
"Set"=dword:00000001
"Exist"=dword:00000000
"Type"=""
"Content"=""
[HKEY_CURRENT_USER\Software\WinRAR\Setup\.tar]
"Set"=dword:00000001
"Exist"=dword:00000001
"Type"=""
"Content"="application/x-tar"
"ShellNew"=""
[HKEY_CURRENT_USER\Software\WinRAR\Setup\.zip]
"Set"=dword:00000001
"Exist"=dword:00000001
"Type"="CompressedFolder"
"Content"="application/x-zip-compressed"
"ShellNew"=""
;设置选项 是(00000001)否(00000000)
[HKEY_CURRENT_USER\Software\WinRAR\Setup]
"MenuIcons"=dword:00000001 ;右键显示图标
"CascadedMenu"=dword:00000001 ;层叠右键菜单
[HKEY_CURRENT_USER\Software\WinRAR\Setup\Links]
"Desktop"=dword:00000000 ;在桌面创建winrar快捷方式
"StartMenu"=dword:00000000 ;把winrar添加到开始菜单
"Programs"=dword:00000000 ;创建winrar程序组
;是(0x10001,01,00,00,00)否(0x10001,00,00,00,00)
[HKEY_CURRENT_USER\Software\WinRAR\Setup\MenuItems]
"ExtrTo"=dword:00000001 ;解压文件到...
"ExtrHere"=dword:00000001 ;解压到当前文件夹
"Extr"=dword:00000001 ;解压到文件名
"ExtrSep"=dword:00000001 ;解压每个压缩文件到单独的文件夹
"OpenSFX"=dword:00000001 ;使用WinRAR打开(自解压文件)
"OpenArc"=dword:00000001 ;使用WinRAR打开(普通文件)
"AddTo"=dword:00000001 ;添加到压缩文件...
"AddArc"=dword:00000001 ;添加到压缩文件名称
"EmailArc"=dword:00000000 ;添加到压缩文件名称并发送电子邮件
"EmailOpt"=dword:00000000 ;压缩并发送电子邮件
"Test"=dword:00000000 ;测试压缩文件
"Convert"=dword:00000000 ;转换压缩文件...
"SFXLocal"=dword:00000001
"SFXNetwork"=dword:00000001
"SFXOther"=dword:00000001
"DragAdd"=dword:00000001 ;右键拖放文件显示压缩菜单
"DragExtr"=dword:00000001 ;右键拖放压缩文件显示解压菜单
这是winrar安装好后导出的注册表,需要转为bat后更改路径为主程序winrar.exe所在的路径,
曾经保存过一个相关的bat,里面有获取当前路径并赋值给对应注册表路径的代码,但有些部分看不懂,无法修改应用
希望有大佬能注释下- @echo off
-
- set "MPC-Be=%~dp0mpc-be"
- set "MPC-BeReg=%MPC-BE:\=\\%"
- if "%1"=="" (
- call :Main
- ) >nul 2>nul
- exit /b
- ::以管理员身份运行
- :Main
- title 文件关联
- fltmc >nul || mshta vbscript:CreateObject("Shell.Application").ShellExecute("%~dpnx0","%*",,"runas",1)(window.close) && exit /b
-
-
- ::执行创建注册表关联项
- :Install
- (
- echo Windows Registry Editor Version 5.00
- call :RegAssoc mp4 MPC-BE 59 mpciconlib
- ) >"%Temp%\Install.reg"
- reg import "%Temp%\Install.reg"
- del /f "%Temp%\Install.reg"
-
- goto :eof
-
- ::关联相关文件类型
- :RegAssoc :: <%1=Ext> <%2=ExeName> <%3=IconIndex图标编号> <%4=图标文件名>
- echo [HKEY_CLASSES_ROOT\MPC-BE.%1\DefaultIcon]
- echo @="\"%MPC-BeReg%\\%4.dll\",%3"
- echo [HKEY_CLASSES_ROOT\MPC-BE.%1\Shell\Open\Command]
- echo @="\"%MPC-BEReg%\\%2.exe\" \"%%1\""
- echo [HKEY_CLASSES_ROOT\.%1]
- echo @="MPC-BE.%1"
- goto :eof
- ::echo @="\"%MPC-BeReg%\\%4.dll\",%3" 本句意为图标在以%4为名称的.dll文件内
复制代码
|