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

使用DevCom和VBS脚本一键开关双网卡使用DevCom和VBS脚本一键开关双网卡 2009年10月06日  网卡1192PCI\VEN_

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

使用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脚本凑合用用