Netsh - a hidden commandline gem
The most recent issue of Windows IT Pro magazine has a short 1 page article from Mark Minasi about Netsh Tricks. The article piqued my interest so I went out to learn a little more about it.
Netsh is the result of a joint effort between Microsoft and Cisco Systems back in the early Windows 2000 days. Netsh allows you to control IP addresses, gateways, DNS servers, and more from the command line. It also lets you do some neat troubleshooting tasks.
Try out Netsh yourself. Hit Start…Run, type CMD and hit OK. Type “netsh ?” and you’ll get a list of 14 different context sensitive commands. Let’s take a quick look at how to change the IP address of your machine. This can be useful if you’re setting up a lab and you want to keep it partitioned by subnet from other labs. You could run the following commands:
View the network IP configuration with this command:
netsh interface ip show config
Get these results
Configuration for interface "Local Area Connection"
DHCP enabled: Yes
InterfaceMetric: 0
DNS servers configured through DHCP: 10.1.0.5
10.1.0.4
10.1.0.10
WINS servers configured through DHCP: 10.1.0.9
Register with which suffix: Primary only
Change your machine’s static IP address with these commands
netsh interface ip set address name="Local Area Connection"
netsh interface ip set address local static 150.100.1.2 255.255.255.0 150.100.1.1 1
Having problems with your PC’s network connection and want to completely rebuild the entire IP stack? Try this command:
netsh int ip reset c:\iplog.txt
If that doesn’t work you could try resetting the entire Winsock catalog, which might be necessary if you’ve recently been the victim of spyware
netsh winsock reset
Want to get an HTMLview of every part of your system including OS build number, service pack number, free memory, and more? This can be accomplished by this command
netsh diag gui

Netsh can be a very powerful tool as it eases configuration changes via scripting. Learn more about Netsh from the Microsoft Documentation