Debian Codegraph @

windows/service-uninstall.bat

raw
1 @set @_cmd=1 /*
2 @echo off
3 setlocal EnableExtensions
4 title DNSCrypt-Proxy
5
6 whoami /groups | findstr "S-1-16-12288" >nul && goto :admin
7 if "%~1"=="RunAsAdmin" goto :error
8
9 echo Requesting privileges elevation for managing the dnscrypt-proxy service . . .
10 cscript /nologo /e:javascript "%~f0" || goto :error
11 exit /b
12
13 :error
14 echo.
15 echo Error: Administrator privileges elevation failed,
16 echo please manually run this script as administrator.
17 echo.
18 goto :end
19
20 :admin
21 pushd "%~dp0"
22 dnscrypt-proxy.exe -service stop
23 dnscrypt-proxy.exe -service uninstall
24 popd
25 echo.
26 echo Thank you for using DNSCrypt-Proxy!
27
28 :end
29 set /p =Press [Enter] to exit . . .
30 exit /b */
31
32 // JScript, restart batch script as administrator
33 var objShell = WScript.CreateObject('Shell.Application');
34 var ComSpec = WScript.CreateObject('WScript.Shell').ExpandEnvironmentStrings('%ComSpec%');
35 objShell.ShellExecute(ComSpec, '/c ""' + WScript.ScriptFullName + '" RunAsAdmin"', '', 'runas', 1);