Windows7 64位系统下创建批处理文件实现快速更换IP的技巧

2015-04-17 18:39

    很多人由于工作需要会将电脑搬到各个地方进行工作,而每次都要进行ip更换,每次都要手动更换ip进行很是麻烦,其实我们可以通过创建批处理文件,来实现快速更换ip的目的,那么要如何操作呢,下面以windows7 64位系统为例,跟大家分享一下具体的创建方法。

Windows7 64位系统下创建批处理文件实现快速更换IP的技巧

  1、首先将以下代码用记事本保存为.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

  2、文件保存好了之后,双击运行即可快速地更换IP了。

    以上就是关于Windows7 64位系统下创建批处理文件实现快速更换IP的技巧,这个快速批处理更换IP的方法适合于经常更换IP或是配置大量服务器IP使用,其他windows系统同样适用。

网友评论

相关阅读

最近更新