Wednesday, October 22, 2008

How to Debug VBScript

Windows Script Host (WSH) is the standard scripting environment on all versions of Windows since Windows 98. You can use it to execute scripts written in a variety of languages, JScript, VBScript, Perl, Python - any language that has a compliant WSH engine. WSH will more or less be superceded by PowerShell V2 which will ship with Windows 7 - there's even a cool new Integrated Script Environment (ISE) in the box. However, WSH will still be around for a while and it's a simple solution for working with Windows Management Interface (WMI) so I figure it's worth a mention.

If you're working with VBScript or JScript and running within the Windows Shell , debugging is a piece of cake. Just pass /X on the command line to cscript.exe and WSH will break into the debugger. Make sure you have Visual Studio or similar installed.

cscript.exe /X myScript.vbs

1 comment:

  1. WOW, very interesting i never about that. another thing intersted i meet today was which i used to convert vbscript into exe