Skip to content

Instantly share code, notes, and snippets.

@realdomdom
Last active June 25, 2022 07:59
Show Gist options
  • Save realdomdom/f07d4d58b9554708a57eb8f7fd47e263 to your computer and use it in GitHub Desktop.
Save realdomdom/f07d4d58b9554708a57eb8f7fd47e263 to your computer and use it in GitHub Desktop.
@echo off
SETLOCAL EnableExtensions
set EXE=Cloudflare WARP.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto STOP
mshta 'vbscript:Execute("CreateObject(""shell.application"").ShellExecute""net"",""start CloudflareWARP"","""",""runas"",1:close")'
timeout /T 10 /nobreak
CD "C:\Program Files\Cloudflare\Cloudflare WARP\"
START "" "C:\Program Files\Cloudflare\Cloudflare WARP\Cloudflare WARP.exe"
exit
:EOF
:STOP
taskkill /im "Cloudflare WARP.exe"
mshta 'vbscript:Execute("CreateObject(""shell.application"").ShellExecute""net"",""stop CloudflareWARP"","""",""runas"",1:close")'
exit
:EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment