Como solía trabajar en una unidad gubernamental, la red interna del gobierno requería enchufar cables de red y acceder a la red externa requería conectarse a wifi. Para cambiar, necesitaba desconectar el cable de red y enchufar el cable de red, lo cual era muy problemático. El hermano a mi lado me enseñó cómo cambiar automáticamente el programa .bat. El código del archivo bat es el siguiente:
Después de ejecutar el archivo .bat del siguiente código, cambiará a Ethernet y apagará wifi y Ethernet 4 al mismo tiempo.
@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
Después de ejecutar el archivo .bat del siguiente código, cambiará a wifi y apagará Ethernet al mismo tiempo.
@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