Tuesday, June 15, 2010

change IP Adrress using a batch file

Change IP Address Using netsh from Command Prompt

Network interface can be changed manually by using netsh command (netsh.exe) from Command Prompt. To change the IP to static IP, use the following command format:

netsh interface ip set address [Connection Name] [Source] [IP] [Netmask] [Gateway] [Metric]

* [Connection Name] is the connection name which the network adapter is assigned to. You can see the name in the Control Panel Network Connections panel or by using the ipconfig /all command from the command prompt.

* [Source] is the source of IP address, whether it is static or dhcp. If you set to dhcp. You can ignore all other remaining parameter.

* [IP] is the IP address you set.

* [Netmask] is the network mask for the IP address.

* [Gateway] is the the gateway IP address.

* [Metric] is the metric for the gateway.

We can now create a batch file from the above info...

Download the completed batch file here and edit...

No comments:

Post a Comment