Skip to content

Instantly share code, notes, and snippets.

@Ge0rg3
Created February 25, 2026 18:37
Show Gist options
  • Select an option

  • Save Ge0rg3/8de9d88d491366da8cf372dd1bcc2a23 to your computer and use it in GitHub Desktop.

Select an option

Save Ge0rg3/8de9d88d491366da8cf372dd1bcc2a23 to your computer and use it in GitHub Desktop.
Shut down TwinGate and open WireGuard
@echo off
REM ----------------------------------------
REM 1. Ensure script is running as Administrator
REM ----------------------------------------
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
REM ----------------------------------------
REM 2. Stop Twingate service
REM ----------------------------------------
sc stop Twingate.Service >nul 2>&1
REM Optional: give the service time to stop
timeout /t 3 /nobreak >nul
REM ----------------------------------------
REM 3. Kill Twingate UI process
REM ----------------------------------------
taskkill /IM Twingate.exe /F >nul 2>&1
REM ----------------------------------------
REM 4. Launch WireGuard
REM ----------------------------------------
start "" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\WireGuard.lnk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment