bat 脚本启用及禁用网卡

启用网卡

需要以管理员身份运行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脚本方式

将脚本发送到桌面远程方式,右击打开“属性”,点击右下角“高级”,在高级里勾选“用管理员身份运行”

image

原文

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
posted @ 2022-01-09 08:19  睡到自然醒的猪  阅读(4902)  评论(0)    收藏  举报

iaoexl at outlook dot com, 返回顶部 →友情链接: 信息港 同城信息