Win7系统下快速批处理更换IP的方法

编辑:系统城 2014-09-05 11:17:05 来源于:系统城 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: http://wap.xtcheng.cc/xtjc/584.html 手机查看

  上班要工作,回家也要工作,但家里的IP与公司的IP段不同,回家工作,每天都得进行IP更换十分的麻烦。在Win7系统下,用户可以通过批处理来实现IP地址的快速更换,具体的操作方式来看一下。

  操作步骤:

  将以下代码用记事本保存为.bat文件,如:IPadd.bat:

  @echo off

  rem eth //eth 为网卡名称,可在网络连接中查询,如”本地链接”

  set eth=”无线网络连接”

  rem ip //ip 为你想更改的IP

  set ip=192.168.1.8

  rem gw //gw 为网关地址

  set gw=192.168.1.1

  rem netmasks //netmasks 为子网掩码

  set netmasks=255.255.255.0

  echo 正在将本机IP更改到: %ip%

  rem

  if %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 》 nul

  if not %gw%==none netsh interface ip set address %eth% static %ip% %netmasks% %gw% 1 》 nul

  echo……………………。

  echo 检查当前本机IP:

  ipconfig

  echo……………………。

  echo 成功将本机IP更改为%ip%!

  pause

  close

  文件保存好了之后,双击运行即可快速地更换IP了,这个快速批处理更换IP的方法适合于经常更换IP或是配置大量服务器IP使用,而且这个方法不仅适用于Win7,其他Windows系统同样适用的。

分享到:

热门图文

热门搜索

返回顶部