windows快速批处理更换IP
时间:2023-12-12 05:29:54 点击:117

  因为家里IP跟单位IP段不一样,每天到家跟单位就要换IP,比较麻烦,于是就做了两个批处理用于快速切换IP和网关。

  @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

展开 ↓

最新游戏更多

最新软件更多

  • 玩家推荐
  • 游戏攻略

峰溢下载站 Copyright(C) 2008- ytdonghua.net All Rights Reserved!

闽ICP备2023006282号-2| 免责声明