Solved

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

Posted on 2006-06-15
7
5,230 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
Comment Utility
Hi modotx,

Check out the following link -

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

____Jags.
0
 

Author Comment

by:modotx
Comment Utility
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
Comment Utility
Is the VBS part of a web page or it is a WSH which runs on windows?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:modotx
Comment Utility
It is a WSH running under Windows.
0
 
LVL 4

Expert Comment

by:noam_dz
Comment Utility
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
Comment Utility
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
Comment Utility
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
method notes when mouse over in eclipse 5 68
haveThree challenge 22 100
bunnyEars2 challenge 6 66
changeXy challenge 13 56
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…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

743 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

15 Experts available now in Live!

Get 1:1 Help Now