네트워크 케이블을 연결하거나 분리할 필요가 없습니다. 마우스를 클릭하면 네트워크 케이블과 WIFI가 자동으로 전환됩니다.

예전에 정부기관에서 일하다보니 정부 내부망은 네트워크 케이블을 꽂아야 하고, 외부망에 접속하려면 Wi-Fi에 연결해야 했고, 전환하려면 네트워크 케이블을 뽑고 콘센트를 꽂아야 했어요. 네트워크 케이블이 너무 귀찮더라구요.. 옆에 계신 형님이 자동으로 .bat 프로그램 전환하는 방법을 가르쳐주셨는데, bat 파일 코드는 다음과 같습니다.

다음 코드의 .bat 파일이 실행되면 이더넷으로 전환되고 Wi-Fi와 이더넷 4가 동시에 꺼집니다. 
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"


if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin



taskkill /f /im VRC_ClientGUI.exe
taskkill /f /im VRC_Pluto.exe



netsh interface set interface "以太网 4" disabled
netsh interface set interface "WLAN" disabled

netsh interface set interface "以太网" enabled



exit

 다음 코드의 .bat 파일이 실행되면 Wi-Fi로 전환되는 동시에 이더넷이 꺼집니다. 
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"


if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin



taskkill /f /im VRC_ClientGUI.exe
taskkill /f /im VRC_Pluto.exe



netsh interface set interface "以太网 4" enabled
netsh interface set interface "WLAN" enabled

netsh interface set interface "以太网" disabled 



exit

 

추천

출처blog.csdn.net/p_s_p/article/details/132380677