用批处理设置固定IP

用批处理设置固定IP
使用记事本编辑以下文字,另存为.bat或.cmd为扩展名的文件即可,例如ipconfig.bat.

@echo off
color 0a
title=设置固定IP的批处理!
echo.
echo.
echo.
echo.
echo.
echo                               准备开始网络设置
echo         ===============================================================
echo                        IP地址             192.168.0.100
echo                        子网掩码           255.255.255.0
echo                        网关               192.168.0.1
echo                        DNS                202.96.134.33
echo         ===============================================================
echo              
echo.
pause
echo 现在开始网络设置

echo 正在设置IP地址和子网掩码…
netsh interface ip set address “本地连接” source=static addr=192.168.0.100 mask=255.255.255.0

echo 正在设置网关…
netsh interface ip set address “本地连接” gateway=192.168.0.1 gwmetric=1

echo 正在设置DNS…
netsh interface ip set dns “本地连接” source=static addr=61.128.128.68

echo 设置完成!
pause
exit


819 Views