Windows Script debugging howto

Source: Internet
Author: User

If you often use vbs or js to write some windows scripts and only know how to debug yourProgramWords
Then you can vomit blood and read this article.

Any type of Windows scripts can be debugged using the script debugger. There are several types of script debugger, the simplest of which is
The script debugger provided by Microsoft can be installed in the form of windows in Windows2000, and you can go to MS in XP
Download from the official website. A better debugger is provided by vs. As early as the interdav of vs6, the script has been well supported.
Debugging, not to mention vs. net2003 and vs. net2005. It is very convenient to start debugging.

The following describes how to debug scripts, wsh scripts, and ASP scripts on HTML pages and HTA respectively. The debugger is divided into two types:
The simple script debugger is short for SD, and vs stands for vs6, 7, and 8. Note that if
If you have vs installed on your machine or you are about to install vs, you should not consider SD. In addition, office2003 also contains a script debugger.
Similar to vs, so it is classified as.

I. html pages and scripts in HTA (*. htm *. HTA *. html *. JS)

First, set in IE to allow IE Script debugging, In tools> Internet Options> advanced.

1. SD

Open the page you want to debug or HTA, open SD, view the running document window in, all open HTML documents are
Here, find the one you want to debug, double-click it, and find the script you want to debug.Code, Where you want to break a breakpoint
And then refresh your page or HTA. The script debugger will be disconnected from the place where you want to break it. SD features
You can use your current script environment to output variable values. Our current environment is HTML and HTA.
In the window, press alert and press enter to view the variables you want to view.

2.

Open the page or HTA you want to debug, open vs, and use vs to open the script file you want to debug.
Breakpoint, and then select the tool in vs> attach to the process. If HTML is used, find the corresponding ie process HTA.
And then refresh the HTML or HTA. The debugger will be disconnected at the breakpoint.
Script debugging is the same as debugging a c ++ or. NET program with vs. The following shows a window for displaying variables, as well as monitoring and other functions,
I will not talk about it here.

Ii. wsh script (*. vbs *. js *. WSC *. WSF)

The wsh script engine also supports script debugging. There is a switch in the cscript command. If you have read the cscript /? You will know,
Cscript 1.vbs // X. With this switch, script debugging is started. If SD is installed, it is started for debugging by default,
If you have not installed sdks and installed the vs or Office Script debugger, you can choose which tool to debug.
For debugging, the program will be disconnected at the entrance of the script, and the rest will be the same as above.

Iii. asp script (*. asp *. Inc)

ASP is not very commonly used now, so I will only introduce the SD method, and I rarely use vs to debug ASP.
I will not introduce it anymore. If you want to find out, the specific method is also the append process. If you have installed IIS and
Allows server-side script debugging in IIS. In main directory-> Configuration-> application debugging, enable ASP Server
Choose server-side script debugging. Access the page you want to debug and open the SD. If it succeeds, you will see the documents under IIS,
You can open the document you want to debug, click the breakpoint, and refresh the page to debug ASP.

From: http://www.cnblogs.com/wscript/archive/2006/11/23/569437.html

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.