Skip to content

Instantly share code, notes, and snippets.

@akirayou
Created August 17, 2021 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akirayou/96f9f2ba015482b18093fe486a0a4c92 to your computer and use it in GitHub Desktop.
Save akirayou/96f9f2ba015482b18093fe486a0a4c92 to your computer and use it in GitHub Desktop.
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