How to Change TCP/IP Configuration Settings Via Command Line on Windows 7
Those users who need to frequently travel for work often find it frustrating to change TCP IP settings whenever they connect their laptop to any network. Added to this going through various TCP/IP setting dialog box and not less than 10 clicks needed to change IP address and other network related settings.
If you are comfortable with command line then here is one easy and fast way to change TCP/IP settings right from Windows 7 command line. Netsh.exe is the default utility which ships with every windows operating system which not only lets you to change local network related settings but you can also configure remote machine using netsh.
Using netsh.exe is pretty simple, just go to run (windows+r keyboard shortcut) and type CMD. Once you are on command line you can execute following command substituting values in place to get desired network settings.
The syntax is:
set address [name=]InterfaceName [source=]{dhcp | static [addr=]IPAddress [mask=]SubnetMask [gateway=]{none | DefaultGateway [[gwmetric=]GatewayMetric]}}
The Example:
set address static 10.0.5.99 255.255.255.0 10.0.5.1 1
Hint: You can save the line in a batch file and run the file when you switch between home and work.
Additional information for Netsh command can be found here at Official Microsoft Technet site.