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.
First of all VBScript is an interpreted language and does not need to be compiled. Then, just open the file you want to debug with Visual Studio (via File --> Open --> File...) In order to start the debugger, just click "Tools / VBScript Debug". The VS JIT debugger asks you, which debugger you want to use.
Click the Start button, and then click Run. In the Open field, type the full path of the script, and then click OK. You can also type WScript followed by the full name and path of the script you want to run.
Run cscript.exe for full command args, I think
cscript //X scriptfile.vbs MyArg1 MyArg2
will run the script in a debugger.
This is for future readers. I found that the simplest method for me was to use Visual Studio -> Tools -> External Tools. More details in this answer.
Easier to use and good debugging tools.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With