Solved

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

Posted on 2006-06-15
7
5,236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

734 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