Debugging Scripts

Debugging Scripts

From Windows NT in a Nutshell by Eric Pearce, O'Reilly and Associates, 1997

Unlike Windows 95, NT does not supply a "step through script" function that allows you to execute your script one line at a time and watch it interact with the remote system. When running .SCP scripts, it does pop up the terminal window as the script executes, but this usually exits too quickly for you to catch the reason for failures. DUN does offer a form of post mortem analysis by recording the interaction between the client (you NT machine running dial-up networking) and the server (the comm-server you are logging into) in a log file, called SYSTEM32RASDEVICE.LOG. You have to specifically enable logging in the Registry in order of this to work.

In KEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesRasManParameters, change the value for Logging from 0 to 1. You do not need to reboot the system for this to take effect, just exit and restart Dial-Up Networking.

Try dialing the entry you are debugging. After it fails or terminates, examine the DEVICE.LOG file:

 	Remote Access Service Device Log 01/09/1997 09:54:55
 	Port: Command to Device:
 	Port: Response from Device:netblazer login:
 	Port: Command to Device:eap
 	Port: Echo from Device :eap
 	Port: Response from Device:
 	Port: Command to

    Requires Free Membership to View

Device:foo Port: Echo from Device : Lo Port: Response from Device:gin incorrect. Netblazer login:
The "Command to Device" lines are text being sent from your computer to the remote computer. The "Response form Device" is what the remote computer sends back. The "Echo from Device" is simply the text you are sending being echoed back by the remote device. The actual exchange would look like this:

 	Your Computer		Remote Computer
 					netblazer login:
 					Login incorrect. 
The echo is normally turned on for everything except passwords. This is another holdover from human interaction, where you expect to see what you are typing. The "Login incorrect" message coming from the comm-server in the "Response from Device" indicates that either the username or password is incorrect and this is the reason the script is failing. Keep in mind that the DEVICE.LOG file may contain your password in clear-text (the password is "foo" in the example). If you are interested in purchasing the book Windows NT in a Nutshell. Go to http://www.oreilly.com/catalog/winnut/

This was first published in January 2000

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.