啟用網卡
需要以管理員身份運行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