tags:

views:

140

answers:

2

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.

+1  A: 

Run cscript.exe for full command args, I think

cscript //X scriptfile.vbs MyArg1 MyArg2

will run the script in a debugger.

Binary Worrier
I am getting an error cscript //X test.vbs ...CScript Error: Initialization of the Windows Script Host failed. (Access is denied.)must be something to do with priviliges on my computer.
Dheer
I can honestly say I've never seen that error sorry, no help here :(
Binary Worrier
You need administrative access to run a debugger.
Tmdean
A: 

Click the mse7.exe installed along with Office typically at \Program Files\Microsoft Office\OFFICE11.

THis will open up the debugger, open the file and then run the debugger in the GUI mode.

Dheer