VBS有自己的方法操作注册表,不必调用BAT
Set WshShell = WScript.CreateObject("WScript.Shell")
'写注册表
WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe\Debugger", "ntsd -d", "REG_SZ"
'读注册表
WScript.Echo WshShell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe\Debugger")
'删注册表
WshShell.RegDelete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe\"