@echo off
rem eth 为网卡名称,可在网络连接中查询,如"Hex"seteth="Hex"
rem ip 为你想更改的IP
setip=192.168.125.88
rem gw 为网关地址
setgw=192.168.125.1
rem netmasks 为子网掩码
setnetmasks=255.255.255.0
echo changing ip to %ip%
rem
netsh interface ipset address %eth% static %ip% %netmasks% %gw% > nul
echo......................... ......................... .........................
echolocal IP ipconfig
ipconfig
echo......................... ......................... .........................
echo Successful!!!!
close
IP自动获取
@echo off
rem eth 为网卡名称,可在网络连接中查询,如"Hex"seteth="Hex"echo changing ip to dhcp
rem
netsh interface ipv4 set address %eth% dhcp
echo......................... ......................... .........................
echolocal IP ipconfig
ipconfig
echo......................... ......................... .........................
echo Successful!!!!
close