level 1
teemo2016j
楼主
ping 172.16.25.215-172.16.25.250段IP
ping到不通的设置为固定IP
@echo off
cd /d %~dp0
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
title --IP自动设置 --
MODE con: COLS=80 lines=30
color 0a
:begin
@rem cls
echo 要把IP设置为(自动获取) 请按 1
echo 要把IP设置为(172.16.25.215-172.16.25.50) 请按 2
echo 要退出 请按 3
echo.
choice /c 123450 /n /m " 请选择【1-3】:"
echo %errorlevel%
if %errorlevel% == 1 goto set_ip1_ip
if %errorlevel% == 2 goto set_ip2_ip
if %errorlevel% == 3 goto end
if %times% == 0 (goto vpn_connect) else (goto begin)
:set_ip1_ip
echo IP自动设置开始....
echo.
echo 自动获取IP地址....
netsh interface ip set address "以太网" dhcp
echo 自动获取DNS服务器....
netsh interface ip set dns "以太网" dhcp
@rem 设置自动获取IP
echo 设置完成
pause
goto end
:set_ip2_ip
echo IP自动设置开始....
echo.
echo 正在设置IP及子网掩码
netsh interface ipv4 set address "以太网" "static" "172.16.25.216" "255.255.255.0" "172.16.25.254"
echo 自动获取DNS服务器....
netsh interface ip set dns "以太网" dhcp
echo 正在设置DNS服务器....
netsh interface ip set dns "以太网" static 8.8.8.8 primary
netsh interface ip add dns "以太网" 114.114.114.114
echo 设置完成
pause
goto end
:end
exit
2018年01月19日 06点01分
1
ping到不通的设置为固定IP
@echo off
cd /d %~dp0
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
title --IP自动设置 --
MODE con: COLS=80 lines=30
color 0a
:begin
@rem cls
echo 要把IP设置为(自动获取) 请按 1
echo 要把IP设置为(172.16.25.215-172.16.25.50) 请按 2
echo 要退出 请按 3
echo.
choice /c 123450 /n /m " 请选择【1-3】:"
echo %errorlevel%
if %errorlevel% == 1 goto set_ip1_ip
if %errorlevel% == 2 goto set_ip2_ip
if %errorlevel% == 3 goto end
if %times% == 0 (goto vpn_connect) else (goto begin)
:set_ip1_ip
echo IP自动设置开始....
echo.
echo 自动获取IP地址....
netsh interface ip set address "以太网" dhcp
echo 自动获取DNS服务器....
netsh interface ip set dns "以太网" dhcp
@rem 设置自动获取IP
echo 设置完成
pause
goto end
:set_ip2_ip
echo IP自动设置开始....
echo.
echo 正在设置IP及子网掩码
netsh interface ipv4 set address "以太网" "static" "172.16.25.216" "255.255.255.0" "172.16.25.254"
echo 自动获取DNS服务器....
netsh interface ip set dns "以太网" dhcp
echo 正在设置DNS服务器....
netsh interface ip set dns "以太网" static 8.8.8.8 primary
netsh interface ip add dns "以太网" 114.114.114.114
echo 设置完成
pause
goto end
:end
exit