What Was I Thinking?

Follies & Foils of .NET Development
posts - 95 , comments - 352 , 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.

Print | posted on Monday, April 14, 2008 11:26 AM | Filed Under [ Visual Studio General Geekiness ]

Feedback

Gravatar

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

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
Gravatar

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

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

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

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
Gravatar

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

It is really very healpful..Thanks a lot for ur solution :)
12/14/2009 12:54 AM | Gopi
Gravatar

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

In somany sites i have searched, but atlast this tips is very useful and comfortable for all scripts beginner .
6/3/2010 11:58 PM | sivakumar
Gravatar

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

not bad
8/30/2011 4:46 AM | Boston Red Sox #2 Jacoby Ellsbur
Gravatar

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

Thanks,This was a true life saver.

Cheers
4/11/2012 2:43 AM | Sriraj
Gravatar

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

Really very useful, Simple and quite effective. Thanks lot.
God Bless
5/9/2012 11:01 PM | ANTONY LEO EDEL
Gravatar

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

Can anyone here recommend an alternative dedicated vbs debugger? I googled and only found this splinetech vbs debugger (Http://www.remotedebugger.com/vbs_debugger/vbs_debugger.asp)? Anyone had any experience with this?
Any other dedicated vbs debuggers out there?
Any input is much appreciated.
6/10/2012 8:07 PM | Steven
Gravatar

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

very usefull, I agree.
But if you want directly edit in visual Studio, take a look at this link:
http://krestenm.blogspot.com.es/2007/12/vbscript-projects-in-visual-studio2.html
5/9/2013 8:56 AM | Santiago
Gravatar

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

Steven, you could use Vbsedit, it's really great and have a free version for testing.
8/16/2017 8:18 PM | Carlos
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 

Powered by: