NETSH in Windows 7

Written by: Tom Carpenter

Many technicians have overlooked this valuable tool that was first introduced in Windows 2000. That's more than ten years ago now and this great command line tool has been sitting in the dust without use for most of us. Now, Microsoft is beginning to test your knowledge of this tool. For example, you may encounter questions about NETSH on the 70-680 or 70-685 exams. For this reason and the fact that you can use NETSH for scripting of network configurations, you should learn the basics of the NETSH command. In this article, I'll get you started by showing you how to use the NETSH shell interface as well as scripting entire commands from the command line.

When you want to work with NETSH interactively, you can open a Command Prompt window and simply type NETSH. You'll see a new prompt something like the following:

netsh>

When you see this prompt, you can begin typing various NETSH commands. In this way, NETSH is similar to the more familiar NSLOOKUP command that is used to query DNS servers. Once you have the NETSH prompt, type ? and press ENTER to see the available commands in the root mode. You'll see a list of commands, which includes interface, wlan, firewall and advfirewall. These four commands are very likely to show up on Microsoft's exams because they are useful to understand as a support technician. Let's explore the interface command. At the NETSH root prompt, simply type interface and press ENTER. You'll see a new prompt like the following:

netsh interface>

Once again, you can type ? and press ENTER to get a list of commands that will work in the interface mode. An important command that works in the interface mode is show interface. With the show interface command, you'll see a listing of the network interfaces on your machine. Another important command is the set command. For example., if you execute the following command from the netsh interface> prompt, you will disable the network connection named Local Area Connection:

set interface name="Local Area Connection" admin=DISABLED

These commands represent just a few examples of the commands available in the NETSH shell interface. However, you should also know that you can execute the NETSH command directly from the command prompt. For example, you can disable the Local Area Connection network connection from the traditional C:\> prompt with the following full command:

netsh interface set interface name="Local Area Connection" admin=DISABLED

Notice that you are simply typing the command entered in the netsh interface> prompt mode with the netsh and interface keywords in front of it. All NETSH commands work in this way.

If you are preparing for the 70-680 or 70-685 exams or simply want to gain the ability to get more done at the command prompt, take some time to explore NETSH. Make sure you explore the four sub-modes or NETSH I mentioned previously - interface, wlan, firewall and advfirewall. In each mode, use the ? to find out about the specific commands and practice executing the commands. You'll master the tool in no time and be better prepared for Microsoft's client and server exams in the future.


View LearnKey course sample clips: Windows 7 Configuration