安装好Microsoft Script Debugger之后,在命令行中使用wscript.exe加//x开关运行需要调试的VBScript脚本,这时Microsoft Script Debugger应该自动执行,并自动在脚本的第一行中断。如果为弹出Microsoft Script Debugger的界面,可能是因为没有在注册表中正确注册调试工具的相关信息。这时,将下面的文本保存为一个.reg文件,然后双击执行(注意安装路径)。
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}]
@="ScriptDebugSvc Class"
"AppID"="{A87F84D0-7A74-11D0-B216-080000185165}"
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\LocalServer32]
@="c:\\Program Files\\Microsoft Script Debugger\\msscrdbg.exe"
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\ProgID]
@="ScriptDebugSvc.ScriptDebugSvc.1"
[HKEY_CLASSES_ROOT\CLSID\{834128A2-51F4-11D0-8F20-00805F2CD064}\VersionIndependentProgID]
@="ScriptDebugSvc.ScriptDebugSvc"