Change IP address using a batch script in Windows 10

Here's how to quickly change your IP address with a batch script in Windows.

First, check the output of the "ipconfig" command. The command will print names of your network interfaces and their settings.

Then, if your ethernet adapter is called "Ethernet", you can set it to DHCP with the following batch script:

netsh interface ipv4 set address name="Ethernet" dhcp
netsh interface ipv4 set dns name="Ethernet" dhcp
pause

If you create a .bat file from that and run it as administrator, your network settings will change to automatic (DHCP).

Other useful netsh examples:

Set your IP to 192.168.1.120 and subnet mask to 255.255.255.0
netsh interface ipv4 set address name="Ethernet" static 192.168.1.120 255.255.255.0

Set gateway address to be 192.168.1.1
netsh interface ipv4 set address name="Ethernet" gateway=192.168.1.1

Remove DNS server settings
netsh interface ipv4 delete dnsserver name="Ethernet" all


Comments

Popular posts from this blog

How to install and play Curse of Monkey Island on Android

How to get rid of coil whine just by tweaking BIOS

How to fix the weird audio bug in Kingdom Come: Deliverance

How to find the ScummVM game folder on Android

How to fix the Anno 1404 out of memory error

Fix for Focusrite Scarlett blue screens on Windows 10