Creating Batch Files and Using them to Schedule Windows Maintenace Tasks

One of the most effective ways to use command line utilities on a Windows XP system is to add them to a batch file, and then schedule them to run automatically using the Scheduled Tasks tool in Control Panel. Going back to the days of MS-DOS, users have used simple batch files to automate everything from defragmenting a hard disk to doing backups with a utility like XXCOPY.

If you’re not familiar with how batch files work, the good news is that on a basic level, they couldn’t be easier. Think of a batch file as a text file that contains a series of command line statements, such as a command followed by switches. Each command is placed on its own line, and will execute according to the parameters you provide. For example, if you placed the command DEFRAG c: /F into a text file, and then saved the file with a .BAT extension, this command would execute every time you double-clicked on the file.

Scheduling a batch file to run automatically is as simple as walking through the Scheduled Task Wizard accessible in the Scheduled Tasks applet in Control Panel. Schedule your batch files to run automatically according to your needs, and then never worry about manually maintaining your system again!

Connecting to Systems Remotely with TELNET

Last but not least, take a closer look at the TELNET command. This command allows you to remotely connect to a server running the Telnet service, and then interact with it as though you were sitting at the command line of that system.

This is a wonderful tool to interact with remote systems, such as those running Linux or Unix, as many Internet servers do. In order to log on to a server via Telnet you’ll need an account configured on that system, as well as some understanding of the remote system’s command line environment.

Tracing Network Communications with the TRACERT Command

In cases where you don’t need the detailed information that PATHPING provides in generating diagnostic information about the route between your PC and a destination host, try the TRACERT command. TRACERT literally traces the path between a source and destination host, showing you which intermediate routers are traversed on the journey.

This command is much quicker than PATHPING, but provides critical information about how long the delay is at each router, thus allowing you to determine why a connection might be slow, for example. For a great overview of how the command works, use TRACERT to trace the route to a server in the UK (say futurenet.co.uk), and then trace the route to a site in Mongolia, such as www.mol.mn.

Testing Network Connectivity with the PATHPING Command

A more advanced version of the PING command, PATHPING provides more detailed network troubleshooting information by not only sending requests to the destination host specified, but also all intermediate routers on the path to the destination. Ultimately, this allows the tool to calculate the degree of packet loss every step of the way to the destination, allowing you to determine where problems are occurring. For example, what might appear to be a problem with the site www.yahoo.com might actually be an issue with one of the routers or links on the way to this server.

Testing Network Connectivity with the PING Command

Perhaps no command line utility is more familiar to users than PING. On a TCP/IP network, the PING utility allows you to determine whether another system is reachable, while at the same time providing basic diagnostic information such as whether any packets are being lost en route. When troubleshooting a network connection, PING is almost always the first tool that any users will unleash to gather basic information. When issued with the –t command, PING will continuously send requests to a host until manually stopped with the CTRL+C command.

Querying DNS Servers with the NSLOOKUP Command

It’s not unusual to run into DNS problems when attempting to connect to Internet-based servers using names like www.yahoo.com. If you find that your are experiencing problems connecting to resources by name, the NSLOOKUP command can be used to query DNS servers for answers. For example, without any switches, the NSLOOKUP command will display information about the DNS server your system is configured to use for lookups.

When followed by a domain name like www.2000trainers.com, the tool will display information about the DNS servers that store information for that domain, as shown below. NSLOOKUP supports a wide variety of subcommands that make it a powerful troubleshooting tool, so be sure to look up the associated topic in Help and Support Center for a more detailed explanation.

Checking for Open Network Connections with the NETSTAT Command

Ever curious about the network connections that your XP systems has open to resources on your local network or the Internet? If so, the NETSTAT utility has the answers. This tool will display information about current connections to and from your system, including details of port numbers in use, the names or addresses or remote systems, and the state of the connection. This is a great tool to gather information if you suspect that outside users may be connected to your system, such as via a Trojan horse application.

Checking TCP/IP Network Settings with IPCONFIG

If you’re connected to a TCP/IP network, the IPCONFIG utility is one that you need to be familiar with. Most users are familiar with the tool from using it to renew an IP address allocated by a DHCP server via the /renew switch. However, IPCONFIG provides a wealth of useful information about your system’s TCP/IP settings, especially when the /all switch is issued. This command will display information about the state of your connection, whether DHCP is being used, the IP address, subnet mask, and default gateway configured on your system, and more.