Use a batch file to set the IP address. If the IP address is set to 192.168.1.8 subnet mask to 255.255.255.0 gateway as 192.168.1.1 primary DNS to 202.96.128.68 backup DNS to 202.96.128.166, you only need to copy the following file content to a notepad, change the extension. bat, run this bat file: echo off CLS title set ip echo is setting IP address, please wait ...... Netsh interface IP Set address "Local Connection" static 192.168.1.8 255.255.255.0 192.168.1.1 1 ECHO is changing DNS settings. Please wait ...... (REM) Netsh interface IP Set DNS "Local Connection" static 202.96.128.68 primary (REM) Netsh interface IP add DNS name = "Local Connection" ADDR = 202.96.128.166 echo ****** congratulations! The modification is complete! * ***** Pause Note: The last parameter 1 is indispensable! If you do not need to set DNS, you can use REM to comment out the two lines of DNS settings. Clear IP Address Settings, set to automatically get IP Address: echo off CLS title clear ipsettings ECHO is clearing IP address, please wait ...... Netsh interface IP Set address name = "Local Connection" Source = DHCP (REM) ECHO is clearing DNS settings. Please wait ...... (REM) Netsh interface IP Set DNS name = "Local Connection" Source = DHCP echo Delete IP settings, set to automatic. Echo **************** congratulations, the command is successfully completed! * ************ Pause
After the settings are complete, you can run CMD and ipconfig/all to view the modified IP address.