Regedit.exe 与 Reg.exe 都支持命令行导入、导出功能。
参考以下VBS代码:- regFile = "reg.bak" '保存的文件位置
- regPath = "HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers" '注册表路径
-
- '导出
- CreateObject("WScript.Shell").Run "regedit /e """ & regFile & """ """ & regPath & """",vbHide
- Msgbox "导出已完成!" & String(3,vbTab), vbSystemModal+vbInformation, WScript.ScriptName
-
- '导入
- CreateObject("WScript.Shell").Run "regedit /s """ & regFile & """",vbHide
- Msgbox "导入已完成!" & String(3,vbTab), vbSystemModal+vbInformation, WScript.ScriptName
复制代码
|