@echooff
call:select"ipaddress""ip"
call:select"PhysicalAddress""mac"
call:select"DefaultGateway""gateway"
call:select"DNSServers""dns"
call:select"Description""netcard"
echo.
echo.
echo歡迎使用網(wǎng)絡(luò )配置信息查看(修改)器
echo.
colora
echo.
echo.
echo.
echo本機IP:%ip%
echo本機MAC:%mac%
echo本機DNS:%dns%
echo網(wǎng)關(guān)IP:%gateway%
echo網(wǎng)卡名稱(chēng):%netcard%
echo.
echo1.修改IP地址2.修改網(wǎng)關(guān)地址3.修改DNS地址4.轉到命令行5.退出
set/pchoice=請選擇:
if"%choice%"=="1"goto1
if"%choice%"=="2"goto2
if"%choice%"=="3"goto3
if"%choice%"=="4"goto4
if"%choice%"=="5"goto5
echo.
:1
set/pIP=請輸入IP地址:
netshinterfaceipsetaddressname="本地連接"source=staticaddr=%IP%mask=255.255.255.0
:2
set/pGW=請輸入網(wǎng)關(guān)地址:
netshinterfaceipsetaddressname="本地連接"gateway=%GW%gwmetric=0
:3
set/pDNS=請輸入主dns地址
netshinterfaceipsetdnsname="本地連接"source=staticaddr=%DNS%register=PRIMARY
setslection4=
set/pDNS2=請輸入備份dns地址
netshinterfaceipadddnsname="本地連接"addr=%DNS2%
netshinterfaceipsetwinsname="本地連接"source=staticaddr=none
:4
@color07
@%windir%\system32\cmd.exe
@cls
@exit
:5
exit
:select
for/f"tokens=2delims=:"%%iin('ipconfig/all^|findstr/i/c:%1')doifnot"!%~2!"==""set"%~2=%%i"
GOTO:eof
聯(lián)系客服