Please copy the following script, save as a. bat file, and change the subnet mask, gateway, IP,DNS, etc. into your
The following code has limitations: In fact, only set 192.168.1.* (2-254), if your IP is something else, you need to modify the code in the 192.168.1.1 switch to your gateway
Copy Code code as follows:
cd\
Cls
@echo off
Color A
: Start
set/p myip= "Please enter an administrator-assigned IP:"
Cls
echo, your IP address is%myip%.
Pause
Color F
Cls
ECHO is modifying your IP address, if there is a firewall eject, please set allow execution, please wait ...
netsh interface ip set address name= "Local Area Connection" Source=static addr=%myip% mask=255.255.255.0
Cls
ECHO is configuring your gateway, if there is a firewall eject, please set allow execution, please wait a moment ...
netsh interface ip set address name= "Local Area Connection" gateway=192.168.1.1 gwmetric=1
Cls
ECHO is configuring your DNS, if there is a firewall eject, please set allow execution, please wait a moment ...
netsh interface ip set DNS name= "Local Area Connection" Source=static addr=192.168.1.1 register=primary
Cls
ECHO is configuring your wins, if there is a firewall eject, please set allow execution, please wait a moment ...
netsh interface ip set wins name= "Local Area Connection" Source=static Addr=none
Cls
ECHO is updating your DNS, please wait a moment ...
Ipconfig/flushdns