Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save Ge0rg3/aa48dd0a010f27be64931ca1d0d9d332 to your computer and use it in GitHub Desktop.
Shut down WireGuard and open TwinGate
@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. Kill WireGuard process (Admin)
REM ----------------------------------------
taskkill /IM wireguard.exe /F >nul 2>&1
REM ----------------------------------------
REM 3. Start Twingate service
REM ----------------------------------------
sc start Twingate.Service >nul 2>&1
REM Optional: wait for service startup
timeout /t 3 /nobreak >nul
REM ----------------------------------------
REM 4. Launch Twingate UI
REM ----------------------------------------
start "" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Twingate.lnk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment