找人修改个批处理命令

来源:百度知道 编辑:UC知道 时间:2024/09/23 14:29:43
电信 网通
198.193.138.168 172.118.0.44
255.245.255.0 225.255.245.255
198.148.148.1 122.158.0.1
DNS
216.2.135.1 221.6.4.27
65.147.37.1 221.6.4.55

要2个改IP和DNS 的批处理命令
电信 网通各一个
@echo off
color a
echo.
echo.
set /p name=请输您的计算机名:
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName" /v ComputerName /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v "NV Hostname" /t reg_sz /d %name% /f
reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters" /v Hostname /t reg_sz /d %name% /f
cls
echo 我们再进行设置IP吧。
@echo off
set slection1=
set/p slection1=请输入IP地址:
netsh interface ip set address name="本地连接" source=static addr=%slection1% mask=255.255.255.0 <

@echo off
color a
netsh interface ip set address name="本地连接" source=static addr=198.193.138.168 mask=255.245.255.0
netsh interface ip set address name="本地连接" gateway=198.148.148.1 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=216.2.135.1 register=PRIMARY
netsh interface ip add dns name="本地连接" addr=65.147.37.1
netsh interface ip set wins name="本地连接" source=static addr=none
pause

@echo off
color a
netsh interface ip set address name="本地连接" source=static addr=172.118.0.44 mask=225.255.245.255
netsh interface ip set address name="本地连接" gateway=122.158.0.1 gwmetric=0
netsh interface ip set dns name="本地连接" source=static addr=221.6.4.27 register=PRIMARY
netsh interface ip add dns name="本地连接" addr=221.6.4.55
netsh interface ip set wins name="本地连接" source=static addr=none
p