views:

1805

answers:

4

I need any tool or IDE environment to debug and test the vb scripts code. Please suggest me for any free one. My vb scripts are standalone (vbs extenstion).

Thanks

A: 

Sadly not free....How to debug Windows Script Host, VBScript, and JScript files

Kev
+2  A: 

VBSEdit

Not free, but has an unlimited trial period with a nag screen.

aphoria
+1  A: 

I think you'll have a hard time finding a free tool that supports real VBS debugging. But I've used this "poor man's technique" in the past. Create a variable at the beginning of your script

blnDebug=False

Then throughout your script add lines to echo what the script is doing or the value of different variables:

if blnDebug Then wscript.echo "Now starting script strFoo=" & strFoo

When you set blnDebug=True then all your debug messages will be written to the console (I always use CScript when running this). By adding these debug messages as you write your script, you can have debugging available simply by changing the bldDebug value.

Certainly commercial editors like PrimalScript include a debugger. SAPIEN also has a standalone debugger, http://www.primalscope.com/, that while not free is a relatively inexpensive option. You can download an eval copy to try it out.

Jeffery Hicks
A: 

There is a really old tool called Script Debugger for Windows NT 4.0 and Later. It is designed for VBScripts running in web pages but you can attach it to a vbs script easy enough.

You can download it from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=2f465be0-94fd-4569-b3c4-dffdf19ccd99&displaylang=en

The name says NT 4.0 I know but I am currently running it on Windows 7 x64 and hod no problems opening the debugger.

Simply install the above tool then run your script from the commandline like:

wscript.exe myscript.vbs //d //x

Once the debugger opens you can step through code and even open a command window where you can check variable values by typeing ? Varname.

Wil Taylor