|
|
设置IP是个比较费劲的事,那么有没有比较简单的方法一键设置呢?
4 V9 m1 X' F5 D& }
0 P: X% Q7 E# h% U$ `6 g" T: g将以下文件复制到新建的文本文档的,然后另存为IP.bat文件,双击运行,根据情况选择。IP地址可以改成适合自己设置的。- @echo off: s% Q8 `6 K- R
- title 自动设置ip* ^8 f" u2 v6 _9 [! Y6 z6 u
- echo
& d( U# j- I* a& K5 K - :start ; A) ~1 U7 B/ |9 C; o
- cls 9 x# } A4 x* H9 c9 L6 N
- ECHO ================================ 0 y0 i& B+ [/ v/ f
- ECHO 请选择要换的ip * D+ {- _, F6 H/ N2 d$ E& `& F' R
- ECHO ———————————————— & j4 R' A* C [$ Q' X
- echo 无线网络连接---自动获取IP地址…………1 ) Z$ h& O5 v7 K8 w1 _8 f6 }$ M
- echo. ; k( q0 j5 d: M2 c$ H1 R. S# l
- echo 无线网络连接---办公室IP配置……………2
3 p' U7 H6 Z# {# r3 f$ p9 r% k. F - echo.
* ]' \/ G: [2 }! U - echo 本地连接---自动获取IP地址………………3 7 p( U Z# A0 w2 N* m
- echo.
# Q0 C! B" t Z( A - echo 本地连接---办公室IP配置…………………4
% K _) p1 @8 W! i* i. p - echo.4 g' ^) s% v% H- ?1 T; F9 n* Y
- echo 退出…………………………………………5
: [- _% K6 Z7 ]; L - echo.) {, p5 C6 A# n0 R0 q' q6 w2 T1 ^
4 Z* P. m, r7 {/ V- @set /p UserSelection=选择(1,2,3,4,5)
: j4 R0 w; _6 `4 S4 F3 W9 g8 s' z
! E4 }- c, C. l- ~/ P3 D* w- if %UserSelection% LEQ 5 if %UserSelection% GEQ 1 goto selection
# S7 k. P |* I; p8 b - goto start [. @8 T, c- B7 K) N. i
8 E1 V4 D& f/ k; U: g, x- :selection
& @' N$ @5 ~# b0 M) F3 A - @if "%UserSelection%"=="1" goto 1 0 R, S/ k$ _" x
- @if "%UserSelection%"=="2" goto 2 u$ |/ Z j- p
- @if "%UserSelection%"=="3" goto 3 ' q/ z+ S3 W: j3 R! q0 Z: O. ^
- @if "%UserSelection%"=="4" goto 4
) F2 F! r; P4 F% o - @if "%UserSelection%"=="5" goto 5) y/ i3 y5 \, Q/ W+ |( y
7 \9 O* M# L q# w6 y, D U" D- :1
% k. L, g$ f. k4 D - echo 无线网络连接---自动获取IP地址---请稍候...
- T1 \- V0 C" ]- m# z* f6 k0 u7 l - netsh interface ip set address name="无线网络连接" source=dhcp7 F2 l; l# X- Y+ [$ D; V
- netsh interface ip set dns name="无线网络连接" source=dhcp5 K0 }% G2 ?. ]6 U; | X
- exit
& b5 W% J5 |( w1 _+ V
3 N: l, K6 a( w$ z* q# W$ b1 T4 k& p- :2
' j0 v& |2 e/ `9 X' K - echo 无线网络连接---办公室IP配置---请稍候...4 f, e1 N, N& _( x( R, x1 q
- set ipaddress=192.168.0.100
& Q; p: p) O; i5 h; j - set subnetmask=255.255.255.0- Y/ ^$ G, B6 ^4 {+ f
- set defaultGateway=192.168.0.1
. s5 h7 x" F9 V0 C% K9 t - set dns=202.96.98.36
- Q. r! ?* o; C3 s+ }' j9 y0 i - netsh set address name="无线网络连接" source=static addr=%ipaddress% mask=%subnetmask% gateway=%defaultGateway% gwmetric=01 R+ u/ e: _- ?: K9 v- b& S9 u
- rem netsh interface ip set address name="无线网络连接" source=static addr=%ipaddress% mask=%subnetmask%5 H0 k" J, ]. Q6 }* d" c7 Q
- rem netsh interface ip set address name="无线网络连接" gateway=%defaultGateway% gwmetric=09 n! w* S6 I& Y5 j3 V. t- Z A
- netsh interface ip set dns name="无线网络连接" source=static addr=%dns% register=primary
9 U3 Q2 y( f3 \ - rem netsh interface ip set dns name="无线网络连接" source=static addr=%dns%
# U" z- |1 \7 b, c e - exit: Q3 r# R, ]! H, v: S
- : [! m( E- ~2 a$ q& L. q
- :30 B3 N8 h/ O, X2 f
- echo 本地连接---自动获取IP地址---请稍候...8 o; P& K& g- _0 I5 f
- netsh interface ip set address name="本地连接" source=dhcp. M6 P# Q% E& R1 Z+ `9 z+ V7 T
- netsh interface ip set dns name="本地连接" source=dhcp: A& {4 O' _3 Y. \7 y
- exit
" n- H l1 W4 k2 Y6 v G - 7 i3 a3 ?8 K2 v: v: r* G+ C
- :4
% n6 E. w0 w* o f' ` R& g - echo 本地连接---办公室IP配置---请稍候...5 K. ^3 _' @ W( h: R# ]+ V5 i2 [; k: @
- set ipaddress=192.168.1.68
! s' r5 d1 U% J7 k$ C7 B - set subnetmask=255.255.255.0! _% w" |# r+ X% ^# j4 v
- set defaultGateway=192.168.1.16 u/ r' ]# U* B+ \
- set dns=202.102.128.685 B$ M: i( D/ Z' C
- netsh interface ip set address name="本地连接" source=static addr=%ipaddress% mask=%subnetmask%
8 ]; M; d1 _0 a! \! {& b0 H# L - netsh interface ip set address name="本地连接" gateway=%defaultGateway% gwmetric=0
) \' v$ h8 O/ o- ~/ w( V - netsh interface ip set dns name="本地连接" source=static addr=%dns% register=primary0 E& K6 S! q1 v* Z' ^) _5 O
- netsh interface ip set dns name="本地连接" source=static addr=%dns%, a0 i& Y- A1 c: g* x6 {7 b M+ }3 @ l
- exit
! Y4 D6 @/ q+ C* E4 ]3 F( C& N
u/ Z$ b1 O$ d* d8 }& }0 g o- :5
5 t+ a5 j' @+ ?! I - echo 5. k: a: X" |8 ]* |' K
复制代码 |
-
-
IP.bat
2.22 KB, 阅读权限: 1, 下载次数: 0
|