Home > Windows Server Tips > > Debugging Scripts
Windows Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 


Debugging Scripts


Eric Pearce
01.27.2000
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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:
 	Password:
 	Port: Command to 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:
 	eap
 					Password:
 	foo
 					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/

Rate this Tip
To rate tips, you must be a member of SearchWindowsServer.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



Server Room Design - Planning, Cooling, Maintenance
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts