Networking / Beginners

Using the Command Prompt

Although the Windows graphical user interface (GUI) is easy to use for most end user tasks, it does have some limitations when troubleshooting network connectivity issues. In contrast, the command prompt can be very useful in troubleshooting basic problems. That is, of course, if you know how to use it.

All the troubleshooting commands in this tutorial use the command prompt.

You can launch the command prompt in just about any Windows system by clicking Start, selecting Run, typing cmd in the text box, and pressing Enter. You have a wealth of help available if you know how to ask. For example, you can just enter the Help command to identify the available commands.

There are many other ways to launch the command prompt, but this method will work with most Windows systems.

The Command Prompt window with the results of the ping loopback command. The first command is using IPv6, and the second command is using IPv4.

Getting Help at the Command Prompt

Most commands have help available by typing in the command and adding a space, a slash (/), and then a question mark (?). For example, all the following commands will give you help:

  • Ipconfig /?
  • Ping /?
  • Pathping /?
  • Tracert /?
  • Netstat /?
  • Telnet /?

The telnet /? command will fail if Telnet is not installed on the system. Steps to install Telnet are included later in this tutorial.

Sometimes the output can scroll past the screen before you have time to read it. You can use the More command with the command to show a single page at a time like this:

ipconfig /? | more You can also redirect the output to a text file that you can read later. The following example sends the output to a text file named config.txt: ipconfig /? > config.txt

Using Switches

Most commands support additional options. These options are added with switches. A switch is a forward slash (/) which would then be followed by the additional option. For example, if you enter ipconfig by itself, it gives minimal information. If you enter it as ipconfig /all (using the /all switch), it gives much more information. Entering the command with the /? switch will show you the switches supported by the command.

Although most commands use the forward slash (/) as a switch, some commands use a hyphen (-). Most Windows commands will accept either a forward slash or a hyphen. For example, the following two commands will both work the same way:

  • ipconfig /all
  • ipconfig -all

The dash is more common in UNIX systems. The forward slash is more common in Microsoft systems. However, you'll see both in Microsoft systems.

Understanding Case Sensitivity

With very little exception, command prompt commands are not case sensitive. In other words, you can enter them all uppercase, all lowercase, or any combination. For example, each of the following commands will provide the same results:

None of the commands presented in this tutorial is case sensitive.

  • ping loopback
  • PiNg LoOpBaCk

You'll often see commands shown with the first letter capitalized for readability. This doesn't mean it has to be entered that way. If a command is case sensitive, the documentation will usually stress it.

Launching the Command Prompt with Administrative Permissions

Some commands require administrative permissions to run. For example, if you try to release a DHCP lease using the ipconfig /release command in Windows 7, you'll see the following error if you haven't logged on as the administrator or started the command prompt with administrative permissions:

The requested operation requires elevation.

If you're logged on with the system "administrator" account, the command prompt is automatically started with administrative permissions. However, if you're logged on with an account that is a member of the Administrators group, the command prompt does not start with administrative permissions.

The solution is to launch the command prompt with administrative permissions before executing the command. You can use the following steps in Windows 7 or Windows Server 2008 with administrative permissions:

  1. Click Start.
  2. Type cmd in the Start Search box.
  3. The cmd shortcut will appear in the Programs list. Right-click cmd.
  4. Select Run As Administrator. If prompted by User Account Control, click Yes to continue or enter appropriate administrator permissions depending on the prompt.
[Contents] [Next]