Windows Script debugging Howto method _vbs

Source: Internet
Author: User
If you often write Windows scripts with VBS or JS and only know how to debug your program with a print variable
Then you can go and spit the blood, and then read this article.

Any type of Windows script can be debugged with a script debugger, with several script debuggers, the simplest of which is
Microsoft Script Debugger, in Windows2000 can be installed in the form of Windows, XP you can go to MS
The official website downloads. A better debugger, is the VS band, as early as the VS6 Interdav has been well supported on the script
debugging, vs.net2003 and vs.net2005, not to mention the debugging of the kicker would have been very convenient.

Here's how to debug scripts in HTML pages and HTA, WSH scripts and ASP scripts, where the debugger is divided into two
The simple script Debugger here for short Sd,vs is referred to as VS on behalf of VS6, 7, 8, here is to note that if
If you have a device in your machine vs or you are ready to install VS, don't consider SD, and office2003 also has a script debugger
and VS, so here's the VS class.

One, HTML pages and scripts in an HTA (*.htm *.hta *.html *.js)

First in IE set, allow IE Script debugging, in the tool->internet option-> advanced.

1. SD

Open the page or HTA you want to debug, open SD, view the Run document window in, and all open HTML documents
will be here, find the one you want to debug, double-click Expand, find the script code you want to debug, where you want to place the breakpoint
Square breakpoint, and then refresh your page or HTA, the script debugger will break down where you want to go. SD is characterized by
You output the values of variables through your current scripting environment, our current environment is HTML and HTA, and we can
In the window, alert your variable return to see the variable you want to see.

2. VS

Open the page or HTA you want to debug, open vs, use vs to open the script file you want to debug, where you want to break
Breakpoint, and then the VS-> tool is attached to the process, if HTML is found corresponding to the IE process HTA.
Mshta process, then append it, then refresh the HTML or HTA, and the debugger will break at the breakpoint, and this time
Script debugging is the same as vs Debug C + + or. NET programs, with the following windows showing variables, and monitoring,
There's not much to say here.

Ii. WSH Script (*.vbs *.js *.WSC *.wsf)

WSH script engine also supports script debugging, cscript command has a switch, if you have seen Cscript/?
cscript 1.vbs//x, use this switch will start script debugging, if you installed SD, will start it by default to debug,
If you do not have SD and installed the VS or Office Script Debugger, will let you choose what tool debugging, you can choose
One to debug, the program will break at the entrance to the script, the rest and the above is the same.

Third, ASP script (*.asp *.inc)

ASP this thing is not very common now, so just to introduce the next SD method, I also rarely use vs debugging ASP so
Do not introduce, if you want to you can grope, concrete method is also attached process. If you have IIS installed and
IIS settings allow server-side script debugging, which is configured in the home directory-> configuration-> application debugging, enable ASP service
The server-side script debugging is selected. Access the page you want to debug, turn on SD, and you'll see the documentation under IIS,
You can open the document you want to debug, and then next breakpoint, refresh the page to debug the ASP.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.