不用插拔网线鼠标点击自动切换网线和WIFI
发布时间:2025-12-09 16:21:09
浏览次数:4
因为之前在zf单位工作,政务内网需要插网线,而访问外网又需要连wifi,切换就需要拔掉网线插上网线很麻烦,旁边老哥教我了一手.bat程序自动切换方法, .bat文件代码如下:
以下代码的.bat文件执行后会切换到以太网,同时关闭掉wifi和以太网4
@echo off%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exitcd /d "%~dp0"if "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begintaskkill /f /im VRC_ClientGUI.exetaskkill /f /im VRC_Pluto.exenetsh interface set interface "以太网 4" disablednetsh interface set interface "WLAN" disablednetsh interface set interface "以太网" enabledexit
以下代码的.bat文件执行后会切换到wifi,同时关闭掉以太网
@echo off%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exitcd /d "%~dp0"if "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begintaskkill /f /im VRC_ClientGUI.exetaskkill /f /im VRC_Pluto.exenetsh interface set interface "以太网 4" enablednetsh interface set interface "WLAN" enablednetsh interface set interface "以太网" disabled exit