win7 批处理自动 修改本地IP地址、无线IP地址.bat
2013-06-05 09:43
633 查看
@echo off title Alpha - IP地址修改工具 MODE con: COLS=80 lines=20 rem IP地址列表 set lname=本地连接 rem 本地连接IP地址一 公司IP地址 set lAdd1=192.168.3.126 set lmask1=255.255.252.0 set lGat1=192.168.3.254 set ldns11=202.96.199.133 set ldns12=202.106.196.115 rem 本地连接IP地址二 家庭IP地址 set lAdd2=192.168.0.115 set lmask2=255.255.255.0 set lGat2=192.168.0.1 set ldns21=202.96.199.133 set ldns22=202.106.196.115 set wname=无线网络连接 rem 无线连接IP地址一 公司IP地址 set wAdd1=%lAdd1% set wmask1=%lmask1% set wGat1=%lGat1% set wdns11=%ldns11% set wdns12=%ldns12% rem 无线连接IP地址二 家庭IP地址 set wAdd2=%lAdd2% set wmask2=%lmask2% set wGat2=%lGat2% set wdns21=%ldns21% set wdns22=%ldns21% :home cls @echo. @echo Alpha - IP地址修改工具 ( KYT -- PanFu ) @echo. @echo 1:设置 %lname% @echo 2:设置 %wname% @echo. @echo 警告:WIN7系统必须 单击右键 [以管理员身份运行(A)] ! @echo. @echo. set shut="" set /p shut="请输入 【<1> 或 <2> 或 <q>退出】 并按回车键 :" IF NOT "%shut%"=="" ( if %shut% NEQ "" SET shut=%shut:~0,1% ) else ( set shut="") if /i %shut%==1 goto locally if /i %shut%==2 goto wireless if /i %shut%==q exit goto home :locally cls @echo. @echo 修改 %lname% IP地址 ( KYT -- PanFu ) @echo. @echo 1:设置 %lname% 自动获取IP地址 @echo 2:设置 %lname% IP地址为公司IP %lAdd1% @echo 3:设置 %lname% IP地址为专用IP %lAdd2% @echo. @echo. set shut="" set /p shut="请输入 【<1> 或 <2> 或 <3> 或 <q>退出】 并按回车键 或者 按<回车键>返回主菜单 :" IF NOT "%shut%"=="" ( if %shut% NEQ "" SET shut=%shut:~0,1% ) else ( set shut="") if /i %shut%==1 goto locallyone if /i %shut%==2 goto locallytwo if /i %shut%==3 goto locallythree if /i %shut%==q exit goto home :wireless cls @echo. @echo 修改 %wname% IP地址 ( KYT -- PanFu ) @echo. @echo 1:设置 %wname% 自动获取IP地址 @echo 2:设置 %wname% IP地址为公司IP %wAdd1% @echo 3:设置 %wname% IP地址为专用IP %wAdd2% @echo. @echo. set shut="" set /p shut="请输入 【<1> 或 <2> 或 <3> 或 <q>退出】 并按回车键 或者 按<回车键>返回主菜单 :" IF NOT "%shut%"=="" ( if %shut% NEQ "" SET shut=%shut:~0,1% ) else ( set shut="") if /i %shut%==1 goto wirelessone if /i %shut%==2 goto wirelesstwo if /i %shut%==3 goto wirelessthree if /i %shut%==q exit goto home rem 设置 本地网络连接 开始 :locallyone @echo. @echo 正在设置 %lname% IP地址 请稍后。。。 call :autolocall %lname% >nul @echo 设置 %lname% 自动获取IP地址成功!! @echo. @echo. goto three :locallytwo @echo. @echo 正在设置 %lname% IP地址 请稍后。。。 call :autowireless %wname% >nul cmd /c netsh interface ip set address name="%lname%" static %ladd1% %lmask1% %lGat1% >nul cmd /c netsh interface ip add dns name="%lname%" %ldns11% index=1 >nul cmd /c netsh interface ip add dns name="%lname%" %ldns12% index=2 >nul @echo 设置 %lname% IP地址成功!!! @echo. @echo 当前IP地址: %ladd1% @echo 当前子网掩码: %lmask1% @echo 当前默认网关: %lGat1% @echo 当前DNS1地址:%ldns11% @echo 当前DNS2地址:%ldns12% @echo. @echo. goto three :locallythree @echo. @echo 正在设置 %lname% IP地址 请稍后。。。 call :autowireless %wname% >nul cmd /c netsh interface ip set address name="%lname%" static %ladd2% %lmask2% %lGat2% >nul cmd /c netsh interface ip add dns name="%lname%" addr=%ldns21% index=1 >nul cmd /c netsh interface ip add dns name="%lname%" addr=%ldns22% index=2 >nul @echo 设置 %lname% IP地址成功!!! @echo. @echo 当前IP地址: %ladd2% @echo 当前子网掩码: %lmask2% @echo 当前默认网关: %lGat2% @echo 当前DNS1地址:%ldns21% @echo 当前DNS2地址:%ldns22% @echo. @echo. goto three :: 设置 本地网络连接 结束 :: 设置 无线网络连接 开始 :wirelessone @echo. @echo 正在设置 %wname% IP地址 请稍后。。。 call :autowireless %wname% >nul @echo 设置 %wname% 自动获取IP地址成功!! @echo. @echo. goto three :wirelesstwo @echo. @echo 正在设置 %wname% IP地址 请稍后。。。 call :autolocall %lname% >nul cmd /c netsh interface ip set address name="%wname%" static %wadd1% %wmask1% %wGat1% >nul cmd /c netsh interface ip add dns name="%wname%" %wdns11% index=1 >nul cmd /c netsh interface ip add dns name="%wname%" %wdns12% index=2 >nul @echo 设置 %wname% IP地址成功!!! @echo. @echo 当前IP地址: %wadd1% @echo 当前子网掩码: %wmask1% @echo 当前默认网关: %wGat1% @echo 当前DNS1地址:%wdns11% @echo 当前DNS2地址:%wdns12% @echo. @echo. goto three :wirelessthree @echo. @echo 正在设置 %wname% IP地址 请稍后。。。 call :autolocall %lname% >nul cmd /c netsh interface ip set address name="%wname%" static %wadd2% %wmask2% %wGat2% >nul cmd /c netsh interface ip add dns name="%wname%" %wdns121% index=1 >nul cmd /c netsh interface ip add dns name="%wname%" %wdns122% index=2 >nul @echo 设置 %wname% IP地址成功!!! @echo. @echo 当前IP地址: %wadd2% @echo 当前子网掩码: %wmask2% @echo 当前默认网关: %wGat2% @echo 当前DNS1地址:%wdns21% @echo 当前DNS2地址:%wdns22% @echo. @echo. goto three :: 设置 无线网络连接 结束 :three ::pause >nul set shut="" set /p shut="请输入 【<a>返回主菜单】 或者 按<其他键>退出:" IF NOT "%shut%"=="" ( if %shut% NEQ "" SET shut=%shut:~0,1% ) else ( set shut="") if /i %shut%==a goto home exit :autolocall cmd /c netsh interface ip set address name="%lname%" static 0.0.0.0 0.0.0.0 0.0.0.0 >nul cmd /c netsh interface ip set address name="%lname%" source=dhcp >nul cmd /c netsh interface ip set dns name="%lname%" source=dhcp >nul ::@echo 设置 %lname% 自动获取IP地址成功! goto :eof :autowireless cmd /c netsh interface ip set address name="%wname%" static 0.0.0.0 0.0.0.0 0.0.0.0 >nul cmd /c netsh interface ip set address name="%wname%" source=dhcp >nul cmd /c netsh interface ip set dns name="%wname%" source=dhcp >nul ::@echo 设置 %wname% 自动获取IP地址成功! goto :eof
相关文章推荐
- win7 批处理自动 修改本地IP地址、无线IP地址.bat
- win7 批处理自动 修改本地IP地址、无线IP地址
- 一个自动修改本地IP地址的BAT
- Win7 Wifi 无线共享批处理bat命令
- 用批处理(.BAT)自动设置计算机名IP地址DNS
- 【小工具】批处理修改IP地址 bat
- 自动修改IP地址的批处理文件
- [BAT]批处理自动修改区域和语言选项
- [BAT]批处理修改IP地址
- windows7 bat自动批处理改变IP地址、DNS和代理设置
- 自动修改IP地址的.bat
- [BAT]批处理修改IP地址
- 用批处理(.BAT)自动设置IP地址、子网掩码、网关、DNS
- [BAT]批处理修改IP地址
- 自动修改IP地址及网卡地址(批处理文件实现)
- [BAT]win7下用批处理脚本自动删除7天以前创建的文件
- 自动修改IP地址的批处理文件
- 自动配置IP地址.bat
- IP自动修改Bat
- WIN7 WIN8 笔记本无线网卡MAC地址修改