原作者地址:https://blog.youkuaiyun.com/zhaozhbcn/article/details/81036641
公司新规定;不许内外网同时连接,来回切很麻烦,百度一番找到脚本;代码如下
命令偶尔对中文无效 建议将以太网改为英文
关有线开无线
netsh interface set interface "以太网" DISABLED
netsh interface set interface "WLAN" ENABLED
开有线关无线
netsh interface set interface "WLAN" DISABLED
netsh interface set interface "以太网" ENABLED
需管理员模式运行
如果加上下列代码 则双击就行了
@ echo off
%1 %2
ver|find "5.">nul&&goto :Admin
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
:Admin
//以下是执行代码
netsh interface set interface "以太网" DISABLED
netsh interface set interface "WLAN" ENABLED