电脑互动吧

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

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

[复制链接]
发表于 2014-10-8 10:00:33 | 显示全部楼层 |阅读模式
  从办公到家庭环境,或者从会议室到办公工位上的IP切换相信已经把你搞的烦死了,win7系统下载那么用下面的2个小脚本吧,呵呵,药到病除。  ?4 x$ i- d' o# ]4 Z" r
  1. 切换成自动获取IP
+ f) g- N6 ^* N3 \& M  @echo off
9 t5 t- w$ K# Q2 f+ D: O! f  netsh interface ip set address name=“local” source=dhcp
* x' ^7 r3 \9 w5 V  netsh interface ip set dns name=“local” source=dhcp
5 B! x' }5 n+ i# q, D. C* {  2. 切换成固定IP2 I  [+ Y/ v: \
  @echo off3 R( y5 `# W3 I/ V4 ^
  netsh interface ip set address local static 192.168.0.84 255.255.255.0 192.168.0.254
. c; l2 Z0 A1 f/ G/ h1 i  netsh interface ip set dns local 192.168.0.254+ B1 n1 L5 Z- O) s; Q
  netsh interface ip add dns local 202.106.196.115 index=2
+ E+ R$ ^4 P* j$ C! R3 A  netsh interface ip add dns local 202.106.0.20 index=3
! F" s2 Z0 k( S3 Z) t  “local” 是你的本地网卡名称,也可能是 “本地连接”,需要自己替换下。xp系统下载如果是2个固定IP间的来回切换,把第2个脚本自己改改吧 :)- c& ?( |( ?. P9 T+ R" D7 M
  dns设置中,第一个是set,表示设置,后面两个则是添加,自己替换成当地的dns server。
; [: S3 ^* x7 S- {0 a
回复

使用道具 举报

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

本版积分规则

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

浙公网安备 33032402001025号

GMT+8, 2025-9-8 18:34 , Processed in 0.061991 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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