
批處理修改注冊表如何為程序添加右鍵打開菜單最后由 3518228042 于 -5-13 12:07批處理修改注冊表,如何獲取路徑添加到注冊表,為程序添加右鍵打開菜單?grepWin.exe可能放在任何位置。注冊表轉BAT內容如下:這個是刪除注冊表項的
下面是需要添加的,但是文件路徑沒添加進去,需要自動獲取文件路徑添加進去并且運行。需要在HKEY_LOCAL_MACHINESOFTWAREClassesDirectoryshell里面添加grepWin項,并且添加字符串值為grepWin.exe的路徑nclick="copycode($('code0'));">復制代碼
- reg delete HKLMSOFTWAREClassesDirectoryshellgrepWin /f
- reg delete HKCR*shellgrepWin /f
需要在HKEY_LOCAL_MACHINESOFTWAREClassesDirectoryshellgrepWin里面添加command項,并且添加字符串值為grepWin.exe的路徑nclick="copycode($('code1'));">復制代碼
- reg add HKLMSOFTWAREClassesDirectoryshellgrepWin /f /v Icon /t REG_SZ /d grepWin.exe,-107
需要在HKEY_CLASSES_ROOT*shell里面添加grepWin項,并且添加字符串值為grepWin.exe的路徑nclick="copycode($('code2'));">復制代碼
- reg add HKLMSOFTWAREClassesDirectoryshellgrepWincommand /f /ve /t REG_SZ /d grepWin.exe /searchpath:%%1
需要在HKEY_CLASSES_ROOT*shellgrepWin里面添加command項,并且添加字符串值為grepWin.exe的路徑nclick="copycode($('code3'));">復制代碼
- reg add HKCR*shellgrepWin /f /v Icon /t REG_SZ /d grepWin.exe,-107
也就是說grepWin.exe必須在C:WindowsSystem32目錄才能運行,REG_SZ /d grepWin.exe這個只有程序名稱,根本沒有路徑值,BAT文件和grepWin.exe文件放在任意目錄,運行后路徑會添加進去,比如當路徑為F:grepWingrepWin.exe時候,BAT執行的命令會變成下面的情況nclick="copycode($('code4'));">復制代碼
- reg add HKCR*shellgrepWincommand /f /ve /t REG_SZ /d grepWin.exe /searchpath:%%1
grepWin.exe論壇下載地址http://batch-cn.qiniudn.com/tool/grepWin.exenclick="copycode($('code5'));">復制代碼
- reg add HKLMSOFTWAREClassesDirectoryshellgrepWin /f /v Icon /t REG_SZ /d F:grepWingrepWin.exe,-107
- reg add HKLMSOFTWAREClassesDirectoryshellgrepWincommand /f /ve /t REG_SZ /d F:grepWingrepWin.exe /searchpath:%%1
- reg add HKCR*shellgrepWin /f /v Icon /t REG_SZ /d F:grepWingrepWin.exe,-107
- reg add HKCR*shellgrepWincommand /f /ve /t REG_SZ /d F:grepWingrepWin.exe /searchpath:%%1

