How to debug howto using Windows scripts

Source: Internet
Author: User

If you often use vbs or js to write some windows scripts and only know how to debug your Program Words
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 in 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 your machine has vs installed or you are about to install vs, do 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.


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 common now, so I will only introduce the SD method, and I rarely use vs to debug ASP. So
I will not introduce it, if you want to, you can find out how to add processes. If you have installed IIS and set to allow server-side script debugging in
IIS, this setting is in the main directory-> Configuration-> application debugging, select enable ASP server
server script debugging. Access the page you want to debug and open SD. If the problem persists, you will see a document under IIS.
you can open the document you want to debug and then click the breakpoint, refresh the page to debug ASP.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.