Solved

Can Visual Studio 2005 be used to debug vbscript files (.vbs)

Posted on 2006-06-15
7
5,232 Views
Last Modified: 2012-05-05
Is there a way to use Visual Studio 2005 to debug VBScript (*.vbs) files?  When I load a vbs file into an empty project it looks like I can set break points and the syntax is color coded (though there does not seem to be any intellisense).
0
Comment
Question by:modotx
7 Comments
 
LVL 10

Expert Comment

by:jagadeesh_motamarri
ID: 16916350
Hi modotx,

Check out the following link -

http://odetocode.com/Articles/425.aspx

____Jags.
0
 

Author Comment

by:modotx
ID: 16916460
There was not a mention of how to debug VBScript when it is in a *.vbs file.  It talks about how to debug vbscript within a web page by connecting to a running process.  Should I somehow cause a vbs script to pause and then try to connect to the cmd.exe process?
0
 
LVL 4

Expert Comment

by:noam_dz
ID: 16918777
Is the VBS part of a web page or it is a WSH which runs on windows?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:modotx
ID: 16918882
It is a WSH running under Windows.
0
 
LVL 4

Expert Comment

by:noam_dz
ID: 16919263
looking at
http://www.google.com/search?num=100&hl=en&lr=&q=interdev+wsh
this looks good and recent:
http://support.microsoft.com/default.aspx?scid=kb;en-us;308364

Interdev is not part of VS 2005.
Visual Web Developer 2005 which is part of VS 2005 isn't mentioned for WSH debugging.

So it seems to me the answer for your q. is no.
0
 
LVL 4

Accepted Solution

by:
Rakafkaven earned 250 total points
ID: 17012679
I may be reading noam_dz's answer wrong, but I think I disagree.  Following the instructions mentioned on http://support.microsoft.com/default.aspx?scid=kb;en-us;308364  and launching my vbs from the Start Menu --> Run... prompt like so:

wscript.exe //d //x C:\myscript.vbs
(replace C:\myscript.vbs with your actual path and scriptname, of course)

...works perfectly for me.  The //x switch triggers an immediate exception, and I received a "Just-In-Time Debugging" pop-up offering a number of debuggers, including a "New instance of Visual Studio".  Once in there, I can step through the code with breakpoints and variable monitoring and everything else a successful debugging party might need.

This won't work for ASP.NET (since ASP.NET doesn't terminate the application when an unhandled exception occurs), but it should work for anything else-- particularly for .vbs files.
0
 
LVL 2

Expert Comment

by:mi1400
ID: 25326019
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Python Encoding Problem \u2013 4 108
wordcount challenge 11 110
How To Loop - Python 19 80
C# code editing and collaboration 3 100
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now