Windows – Change the IP address from the command line with Netshell
Submitted by admin on Friday, 13 January 2012No Comment
Under Windows 2000/Windows XP and above, it is possible to change the TCP / IP from a single command line, for example to automate this task with a script.
This is possible thanks to the tool netsh.exe (NetShell), whose parameters are specified below.
Setting the IP address
For setting a static IP address
netsh interface ip set address "Description" static address%%%%% netmask gateway metric%%%
- Description refers to a text describing the connection name
- %% Address means the IP address
- %% Netmask is the subnet mask
- %% Gateway is the IP address of the gateway
- %% Metric is the metric of the network card (in general = 1)
For example:
netsh interface ip set address "LAN" static 192.168.0.3 255.255.255.0 192.168.0.1 1
For setting up a dynamic IP address (DHCP)
netsh interface ip set address "Description" dhcp
Setting the name server (DNS)
netsh interface ip set dns "Description" static DNS%%
- %% Means the DNS server IP address DNS

Leave your response!