|
:Set_net2
cls
color 07
title 网络设置控制器-电信共享上网2套
Echo ╭────────╮
Echo ╭───────────┤输入IP相关信息 2├───────────╮
Echo │ ╰────────╯ │
Echo │ │
Echo │说明:局域网的私有IP地址格式为:192.168.x.x,现需要输入X的相关值│
Echo │ │
Echo │,使之成为完整的IP地址。第一个x(第3节数字)为0-254之间的值;第 │
Echo │ │
Echo │二个x(第4节数字)为1-254之间的值。网关地址格式为:192.168.x.x,│
Echo │ │
Echo │当然,第一个x(第3节数字)的x不用输入,因为它跟着IP地址已经输入 │
Echo │ │
Echo │,第二个x(第4节数字)为1-254之间的值。 │
Echo │ │
Echo ╰────────────────────────────────╯
Echo.
Set ip3=
Set /p ip3=请输入IP地址的第3节数字(0-254):
If "%ip3%"=="" Goto Set_net2_err
If %ip3% LSS 0 Goto Set_net2_err
If %ip3% GEQ 255 Goto Set_net2_err
Echo.
Echo IP地址是:192.168.%ip3%.等待输入
Echo.
Set ip4=
Set /p ip4=请输入IP地址的第4节数字(1-254):
If "%ip4%"=="" Goto Set_net2_err
If %ip4% LSS 1 Goto Set_net2_err
If %ip4% GEQ 255 Goto Set_net2_err
Echo.
Echo 你输入的IP地址是:192.168.%ip3%.%ip4% 网关地址是:192.168.%ip3%.等待输入
Echo.
Set gw4=
Set /p gw4=请输入网关地址的第4节数字(1-254):
If "%gw4%"=="" Goto Set_net2_err
If %gw4% LSS 1 Goto Set_net2_err
If %gw4% GEQ 255 Goto Set_net2_err
Echo.
Echo 你输入的网关地址是:192.168.%ip3%.%gw4%
Echo.
Echo 请稍候,正在设置之中...
Call :netlike_name
netsh interface ip Set address %netadap% source=static addr=192.168.%ip3%.%ip4% mask=255.255.255.0 >nul
netsh interface ip Set address %netadap% gateway=192.168.%ip3%.%gw4% gwmetric=1 >nul
netsh interface ip Set dns name= %netadap% source=static addr=202.96.128.86 >nul
netsh interface ip add dns name= %netadap% addr=202.96.128.166 index=2 >nul
Goto set_ok
:Set_net2_err
cls
color 0c
title 网络设置控制器-提示信息
Echo.
Echo 输入错误,按任意键请重新开始...
pause>nul
Goto Set_net2
如何改?谢谢! |
|