Created
August 17, 2021 01:29
-
-
Save akirayou/96f9f2ba015482b18093fe486a0a4c92 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set BAT=%~0 | |
@if "%1"=="R" ( | |
FOR /F "tokens=3 usebackq" %%i in (`netstat -rn ^|findstr /R "\<0\.0\.0\.0" ^|findstr 172`) do ( | |
echo the IP is %%i | |
route delete 0.0.0.0 mask 0.0.0.0 %%i | |
route add 172.16.0.0 mask 255.240.0.0 %%i | |
goto exit_for | |
) | |
:exit_for | |
)else ( | |
REM 管理者モードになって、デフォルトルートの設定を調整 | |
powershell start-process %BAT% R -verb runas | |
REM 以下はwstunnelの設定各自書き換えること | |
start/min cmd /c wstunnel -t 53389:172.19.180.33:3389 ws://172.19.180.203/p/12828 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment