ip地址切換批處理腳本分享
更新時間:2014年03月13日 15:07:20 作者:
這篇文章主要介紹了ip地址切換批處理腳本,改一下就可以就成IP地址切換器了,如果你有二個網(wǎng)絡在使用一定會用的到,我在公司就是這么做的,需要的朋友可以參考下吧
復制代碼 代碼如下:
@echo off
rem # ----------------------------------
rem # 接口 IP 配置
rem # ----------------------------------
echo "=========IP 控制管理=========="
echo "=> d: 自動獲取IP"
echo "=> h: 寢室 IP地址:66.168.1.8"
echo "=> r: 公司網(wǎng)絡 IP地址:192.168.250.173"
echo "請輸入對應的序號d,h,r,按回車鍵結(jié)束: "
set /p ch=
if %ch%=="" echo "You input null"&goto :EOF
set case=d,h,t,w>nul
echo %case%|findstr "\<%ch%\>">nul&if errorlevel 1 goto :err
goto %ch%
goto err
:h
:: "寢室"
echo "configure home ip address gateway,please wait 30 second ..."
@netsh int ip set address "本地連接" static 66.168.1.8 255.255.255.0 66.168.1.1 1 >nul
@netsh int ip set dns "本地連接" static 66.168.1.1 PRIMARY >nul
echo home ip configure is done
goto :EOF
:r
:: "公司網(wǎng)絡"
echo "configure transport ip address gateway,please wait 30 second ..."
@netsh int ip set address "本地連接" static 192.168.250.173 255.255.255.0 192.168.250.1 1 >nul
echo transport ip configure is done
goto :EOF
:d
:DHCP "自動獲取IP地址"
echo "configure transport ip address gateway,please wait 30 second ..."
@netsh int ip set address "本地連接" dhcp >nul
@netsh int ip set dns "本地連接" dhcp >nul
:err
:: "error"
echo your input "%ch%" ,no this argument ! please input h or w! game over
rem # 接口 IP 配置結(jié)束
相關文章
windows使用批處理發(fā)布web到tomcat并啟動tomcat腳本分享
這篇文章主要介紹了windows使用批處理發(fā)布web到tomcat并啟動tomcat的腳本,需要的朋友可以參考下2014-03-03Country使 MS-DOS 子系統(tǒng)能使用國際時間、日期、貨幣、大小寫轉(zhuǎn)換和小數(shù)分隔符
Country使 MS-DOS 子系統(tǒng)能使用國際時間、日期、貨幣、大小寫轉(zhuǎn)換和小數(shù)分隔符...2007-09-09