- @echo off
- echo 選擇要設(shè)置的IP方式,然后按回車:
- echo .
- echo 1. 辦公室
- echo 2. 宿舍
- echo 3. 自動(dòng)
- echo .
- set v=
- set /P v=選擇:
- if not '%v%'=='' set v=%v:~0,1%
- echo .
- if '%v%'=='1' goto 1
- if '%v%'=='2' goto 2
- if '%v%'=='3' goto 3
- goto 3
- echo .
-
- :1
- netsh interface ip set address "本地連接" static 10.162.11.245 255.255.0.0 10.160.255.254 1
- goto success
- :2
- netsh interface ip set address "本地連接" static 10.163.11.245 255.255.0.0 10.16.255.254 1
- goto success
- :3
- netsh interface ip set address "本地連接" source=dhcp
-
- :success
- exit
@echo offecho 選擇要設(shè)置的IP方式,然后按回車:echo .echo 1. 辦公室echo 2. 宿舍echo 3. 自動(dòng)echo .set v=set /P v=選擇:if not '%v%'=='' set v=%v:~0,1%echo .if '%v%'=='1' goto 1if '%v%'=='2' goto 2if '%v%'=='3' goto 3goto 3echo .:1netsh interface ip set address "本地連接" static 10.162.11.245 255.255.0.0 10.160.255.254 1goto success:2netsh interface ip set address "本地連接" static 10.163.11.245 255.255.0.0 10.16.255.254 1goto success:3netsh interface ip set address "本地連接" source=dhcp:successexit