当前所在位置:珠峰网资料 >> 计算机 >> 软件水平 >> 正文
两个Windows下自动切换IP小脚本
发布时间:2011/1/20 15:33:33 来源:城市学习网 编辑:ziteng

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

  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。

广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved