使用DevCom和VBS脚本一键开关双网卡

本文介绍了一个批处理脚本,用于快速切换两个Realtek RTL8139/810xFamily Fast Ethernet NIC网卡的IP地址设置,并自动重启网络连接。包括从172网络到192网络的切换,反之亦然。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用DevCom和VBS脚本一键开关双网卡
2009年10月06日
  网卡1 192 PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&28F0
  : Realtek RTL8139/810x Family Fast Ethernet NIC
  网卡2 172 PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&60F0: Realtek RTL8139/810x Family Fast Ethernet NIC #2
  一键改172并重启网卡.bat
  echo 网卡全关
  devcon.exe disable *8139*echo 172网卡设置IP参数
  netsh interface ip set address name="172" source=static addr=172.16.1.58 mask=255.255.255.0
  netsh interface ip set address name="172" gateway=172.16.1.252 gwmetric=0
  netsh interface ip set dns name="172" source=static addr=172.16.1.252 register=PRIMARY echo 调用VBS脚本开启172网卡
  start 开172关192.vbs-------------------------------------------------------------
  开172关192.vbs
  '本地链接为192
  'PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&60F0 本地链接为192
  strNICName = " disable @*60F0"
  Set objShell = CreateObject("Wscript.Shell")
  strCommand = "c:\windows\devcon.exe"& strNICName
  objShell.Run strCommand, 0, False
  '本地链接为172
  'PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&28F0
  strNICName = " enable @*28F0"
  Set objShell = CreateObject("Wscript.Shell")
  strCommand = "c:\windows\devcon.exe"& strNICName
  objShell.Run strCommand, 0, False
  ========================================================================
  一键改192为58、关闭172重启网卡.bat
  echo 网卡全关
  devcon.exe disable *8139*echo 192网卡设置IP参数
  netsh interface ip set address name="192" source=static addr=58.216.198.98 mask=255.255.255.252
  netsh interface ip set address name="192" gateway=58.216.198.97 gwmetric=0
  netsh interface ip set dns name="192" source=static addr=221.228.255.1 register=PRIMARY
  netsh interface ip add dns name="192" addr=218.2.135.1echo 调用VBS脚本开启192网卡
  start 开192关172.vbs--------------------------------------------------------------
  开192关172.vbs
  '本地链接为192
  'PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&60F0 本地链接为192
  strNICName = " enable @*60F0"
  Set objShell = CreateObject("Wscript.Shell")
  strCommand = "c:\windows\devcon.exe"& strNICName
  objShell.Run strCommand, 0, False
  '本地链接为172
  'PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&28F0
  strNICName = " disable @*28F0"
  Set objShell = CreateObject("Wscript.Shell")
  strCommand = "c:\windows\devcon.exe"& strNICName
  objShell.Run strCommand, 0, False=========================================================================
  开启双网卡
  echo 网卡全关
  devcon.exe disable *8139*echo 172网卡设置IP参数
  netsh interface ip set address name="172" source=static addr=172.16.1.58 mask=255.255.255.0
  netsh interface ip set address name="172" gateway=172.16.1.252 gwmetric=0
  netsh interface ip set dns name="172" source=static addr=172.16.1.252 register=PRIMARYecho 192网卡设置IP参数
  netsh interface ip set address name="192" source=static addr=192.168.1.1 mask=255.255.255.0
  netsh interface ip set address name="192" gateway=192.168.1.1 gwmetric=0 echo 调用VBS脚本开启两块网卡
  start 开172开192.vbs-----------------------------------------------------
  开172开192.vbs
  '本地链接为192
  'PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&60F0 本地链接为192
  strNICName = " enable @*60F0"
  Set objShell = CreateObject("Wscript.Shell")
  strCommand = "c:\windows\devcon.exe"& strNICName
  objShell.Run strCommand, 0, False
  '本地链接为172
  'PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&1AF1648C&0&28F0
  strNICName = " enable @*28F0"
  Set objShell = CreateObject("Wscript.Shell")
  strCommand = "c:\windows\devcon.exe"& strNICName
  objShell.Run strCommand, 0, False
  本来想直接通过批处理开启和禁用两块网卡但一启动两块都一起开启了,水平有限网上搞了个别人的VBS脚本凑合用用
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值