启用网卡
需要以管理员身份运行bat脚本
netsh interface set interface "Npcap Loopback Adapter" enabled
netsh interface set interface "vEthernet (默认开关)" enabled
netsh interface set interface "VirtualBox Host-Only Network" enabled
netsh interface set interface "VMware Network Adapter VMnet1" enabled
netsh interface set interface "VMware Network Adapter VMnet8" enabled
netsh interface set interface "WLAN" enabled
禁用网卡
需要以管理员身份运行bat脚本
netsh interface set interface "Npcap Loopback Adapter" disable
netsh interface set interface "vEthernet (默认开关)" disable
netsh interface set interface "VirtualBox Host-Only Network" disable
netsh interface set interface "VMware Network Adapter VMnet1" disable
netsh interface set interface "VMware Network Adapter VMnet8" disable
netsh interface set interface "WLAN" disable
以管理员身份启动bat脚本方式
将脚本发送到桌面远程方式,右击打开“属性”,点击右下角“高级”,在高级里勾选“用管理员身份运行”
原文
https://www.cnblogs.com/wufj/p/13096624.html
附:自动打开Windows远程桌面
' 设置变量:远程服务器IP
ip = "192.168.0.112"
' 创建后台对象
Set ws = CreateObject("Wscript.Shell")
' 后台启动远程桌面系统
ws.run "mstsc /v:" & ip,1
' 参考:https://blog.csdn.net/chengyaosou0528/article/details/100993092