假设内网网卡的ID是VEN_13F0,外网网卡的ID是VEN_10EC。
- (1)切换到内网(LocalLan.bat)
- devcon.exe disable = net PCI\VEN_10EC
- devcon.exe enable = net PCI\VEN_13F0
-
- (2)切换到外网(Internet.bat)
- devcon.exe disable = net PCI\VEN_13F0
- devcon.exe enable = net PCI\VEN_10EC
复制代码
PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&3A321F38&0&20F0
PCI\VEN_10EC&DEV_8139&SUBSYS_813910EC&REV_10\4&3A321F38&0&50F0
区别之处是末尾的20F0和50F0,因此使用通配符来标识,@*20F0和@*50F0;然后采用vbs执行命令就大功告成了。
- strNICName = " disable @*50F0"
- Set objShell = CreateObject("Wscript.Shell")
- strCommand = "D:\devcon\devcon.exe"& strNICName
- objShell.Run strCommand, 0, False
- strNICName = " enable @*20F0"
- Set objShell = CreateObject("Wscript.Shell")
- strCommand = "D:\devcon\devcon.exe"& strNICName
- objShell.Run strCommand, 0, False
-
复制代码
|