Problem solve Get help with specific problems with your technologies, process and projects.

Netsh.exe offers a unique 'view'

You may have heard of Netsh.exe, but you may not know what it's capable of doing for you. Read this tip and learn about the numerous ways this customizable command can be useful.

Please let us know how useful you find this tip by rating it below!

Do you know what Netsh.exe is capable of doing for you?

One task you can use it for is viewing your TCP/IP settings.

Type the following command in a Command Prompt window (CMD.EXE):
netsh interface ip show config

You can configure your computer's IP address and other TCP/IP related settings. For example, the following command configures the interface named Local Area Connection with the static IP address, the subnet mask of and a default gateway of
netsh interface ip set address name="Local Area Connection" static 1

(The above line is one long line, so watch for word wrap. Copy and paste it as one line.)

Netsh.exe can also be useful in certain situations when you have a portable computer that needs to be relocated between two or more office locations, while still maintaining a specific and static IP address configuration. With Netsh.exe, you can save and restore the appropriate network configuration all from the command prompt.

Connect your portable computer to location #1, and then manually configure the required network settings.

Now, you need to export your current IP settings to a text file. Use the following command:
netsh -c interface dump > c:\location1.txt

When you reach location #2, do the same thing, only keep the new settings to a different file:
netsh -c interface dump > c:\location2.txt 

You can go on with as many other locations you may need.

Now, whenever you need to travel between locations, you can enter the following command in a Command Prompt window (CMD.EXE):
netsh -f c:\location1.txt or netsh -f c:\location2.txt. 

Netsh.exe can also be used to configure your NIC to automatically obtain an IP address from a DHCP server:
netsh interface ip set address "Local Area Connection" dhcp

You can use this command to setup WINS:
netsh interface ip set wins "Local Area Connection" static

Or, if you want, you can configure your NIC to dynamically obtain its DNS settings:
netsh interface ip set dns "Local Area Connection" dhcp

As you can see, Netsh.exe is very customizable and useful.

ABOUT THE AUTHOR: Ron is the PC systems administrator at military and government contractor MPD Inc., of Owensboro, KY. He is the administrator for SMS 2.0, SMS 2003, Exchange 2000, Active Directory, Windows 2000 Server and Windows Server 2003, PC desktops, workstations and laptops.

Dig Deeper on Windows Server troubleshooting

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.