电脑互动吧

 找回密码
 注册
查看: 7210|回复: 0

两个Windows系统下自动切换IP小脚本

[复制链接]
发表于 2014-10-8 10:00:33 | 显示全部楼层 |阅读模式
  从办公到家庭环境,或者从会议室到办公工位上的IP切换相信已经把你搞的烦死了,win7系统下载那么用下面的2个小脚本吧,呵呵,药到病除。
" M( n, a7 K- ?: n; I5 g  1. 切换成自动获取IP; R3 S2 L( z2 ?# K! J% \0 L
  @echo off* Q) R' M. c3 y, {' y4 z5 E
  netsh interface ip set address name=“local” source=dhcp5 T' R9 b  s8 d1 T! J# I: D! s8 W
  netsh interface ip set dns name=“local” source=dhcp: C, G& A" _) F, \, H5 U
  2. 切换成固定IP
6 y9 ~# N  H$ P+ G5 ~& Y( c  @echo off8 K" c8 F* i2 ^6 P: y4 b3 m
  netsh interface ip set address local static 192.168.0.84 255.255.255.0 192.168.0.254
* p" E7 \  o* O  netsh interface ip set dns local 192.168.0.254
: E5 q- d) a  ?! z. _4 j6 ^  netsh interface ip add dns local 202.106.196.115 index=2
6 X. r2 U0 E" \$ @9 a* s9 a0 E/ G  netsh interface ip add dns local 202.106.0.20 index=3
& ]9 w8 H3 y! j3 g  “local” 是你的本地网卡名称,也可能是 “本地连接”,需要自己替换下。xp系统下载如果是2个固定IP间的来回切换,把第2个脚本自己改改吧 :)* N0 J2 [2 e: w: X; Z8 Q7 A" B( X
  dns设置中,第一个是set,表示设置,后面两个则是添加,自己替换成当地的dns server。4 a+ F6 z( A) V. r! K* f
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系我们|手机版|小黑屋|Archiver|电脑互动吧 ( 浙ICP备13037409号 )

浙公网安备 33032402001025号

GMT+8, 2026-6-17 07:11 , Processed in 0.058835 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表