Created
January 10, 2011 18:50
-
-
Save ninehills/773236 to your computer and use it in GitHub Desktop.
为各个不同环境设置电脑ip,环境:win7中文版,需要管理员权限运行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
choice /C 1234 /M "Please Enter Your Environment:(1-Hostel_WLAN, 2-Hostel_LAN,3-5J108, 4-5J315)" | |
if errorlevel 4 goto Room315 | |
if errorlevel 3 goto Room108 | |
if errorlevel 2 goto Hostel_LAN | |
if errorlevel 1 goto Hostel_WLAN | |
:Room315 | |
netsh interface ip set address name="无线网络连接" source=dhcp | |
netsh interface ip set dns name="无线网络连接" source=static addr=202.113.16.10 register=primary | |
goto END | |
:Room108 | |
netsh interface ip set address name="本地连接" source=static addr=202.113.229.253 mask=255.255.255.128 gateway=202.113.229.129 | |
netsh interface ip set dns name="本地连接" source=static addr=202.113.16.10 register=primary | |
goto END | |
:Hostel_LAN | |
netsh interface ip set address name="本地连接" source=static addr=10.22.33.26 mask=255.255.255.0 gateway=10.22.33.1 | |
netsh interface ip set dns name="本地连接" source=static addr=202.113.16.10 register=primary | |
goto END | |
:Hostel_WLAN | |
netsh interface ip set address name="无线网络连接" source=static addr=10.22.33.24 mask=255.255.255.0 gateway=10.22.33.1 | |
netsh interface ip set dns name="无线网络连接" source=static addr=202.113.16.10 register=primary | |
goto END | |
:END | |
@echo on | |
@echo IP Address Set Finish | |
@echo off | |
pause | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment