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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM