当前位置:操作系统 > Windows Xp >>

WinXP系统自动切换IP设置教程

1. 切换成自动获取IP

  以下是代码片段:

  @echo off

  netsh interface ip set address name=“local” source=dhcp

  netsh interface ip set dns name=“local” source=dhcp

 

  2. 切换成固定IP

  以下是代码片段:

  @echo off

  netsh interface ip set address local static 192.168.0.84 255.255.255.0 192.168.0.254

  netsh interface ip set dns local 192.168.0.254

  netsh interface ip add dns local 202.106.196.115 index=2

  netsh interface ip add dns local 202.106.0.20 index=3

  “local” 是你的本地网卡名称,也可能是 “本地连接”,需要自己替换下。如果是2个固定IP间的来回切换,把第2个脚本自己改改吧 :)

  dns设置中,第一个是set,表示设置,后面两个则是添加,自己替换成当地的dns server。

      从办公到家庭环境,或者从会议室到办公工位上的IP切换相信已经把你搞的烦死了,那么用下面的2个小脚本吧,呵呵,药到病除。

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,