Blog Stats
  • Posts - 27
  • Articles - 0
  • Comments - 48
  • Trackbacks - 0

 

QuickTip: Debugging VBS Files with CScript.exe and Visual Studio

This is another one of those "Posted here for MY convenience" tips.

You can use the Visual Studio Debugger to debug a .vbs (vbscript) file executed with cScript.exe by using the //X flag at the command line.  

 

To debug MyTest.vbs

cscript.exe MyTest.vbs //X

 

The //X will set a breakpoint and invoke the "select a debugger"  dialog where you can choose Visual Studio and step into your vbs code.  I haven't found a way to directly edit from the debugger however, so I end up having to debug, break execution, fix my bug and restart the vbs script file again to see my changes.


Feedback

# re: QuickTip: Debugging VBS Files with CScript.exe and Visual Studio

Gravatar Nice tip,thanks.
I wish this would work for ASP Classic, too. But I think I have to wait for VS2008 SP1 to do this.

Nicolai

4/19/2008 4:24 PM | Nicolao Stoy

# re: QuickTip: Debugging VBS Files with CScript.exe and Visual Studio

Gravatar What exactly are you trying to do? 4/19/2008 4:51 PM | Chris

# re: QuickTip: Debugging VBS Files with CScript.exe and Visual Studio

Gravatar I amfacing same problem, I was very much comfortable with visual studio debugger, then i installed MS script debugger and after uninstalling same i am not getting option to reattach visualstudio debug any hint??? 6/2/2008 7:14 PM | Urmil

Post a comment





 

Please add 3 and 2 and type the answer here:

 

 

Copyright © ChrisD