How do I debug a stand-alone VBScript script?

Dheer picture Dheer · Feb 18, 2010 · Viewed 123.2k times · Source

I have a VBScript script that takes 2 command-line arguments and does some validation. I need to debug this to see how the program is getting executed. I was trying to paste this into Excel (using VBA). However there are some constructs like Const, etc. that are not being supported, plus certain validations like taking the command-line arguments are failing.

Hence I would like to know if there is any way to debug this script. I have Windows XP and Office 2003 installed. I cannot install any other applications on the office computer.

Answer

Binary Worrier picture Binary Worrier · Feb 18, 2010

Run cscript.exe for full command args, I think

cscript //X scriptfile.vbs MyArg1 MyArg2

will run the script in a debugger.