1
0
mirror of https://github.com/DNSCrypt/dnscrypt-proxy.git synced 2024-12-13 22:46:44 +01:00
dnscrypt-proxy/windows/service-restart.bat
Frank Denis e20c980b15 Use CMD.EXE /c to run Windows commands
That sounds very weird to me, but @mazesy said it was the right
thing to do.
2018-04-10 20:04:03 +02:00

24 lines
585 B
Batchfile
Executable File

@ECHO OFF
SFC 2>&1 | FIND /i "/SCANNOW" >NUL
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE
GOTO ADMINTASKS
:ELEVATE
ECHO Elevated privileges are temporarily required, just to register or remove the dnscrypt-proxy service
CD /d %~dp0
MSHTA "javascript: var shell = new ActiveXObject('shell.application'); shell.ShellExecute('%~nx0', '', '', 'runas', 1); close();"
EXIT
:ADMINTASKS
CD /d %~dp0
CMD.EXE /c "dnscrypt-proxy.exe -service stop"
CMD.EXE /c "dnscrypt-proxy.exe -service start"
ECHO ""
SET /P _=Thank you for using dnscrypt-proxy! Hit [RETURN] to finish
EXIT