From e20c980b1540bc1220f65e192b7074693d4453bc Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 10 Apr 2018 20:04:03 +0200 Subject: [PATCH] Use CMD.EXE /c to run Windows commands That sounds very weird to me, but @mazesy said it was the right thing to do. --- windows/service-install.bat | 18 ++++++++++-------- windows/service-restart.bat | 18 ++++++++++-------- windows/service-uninstall.bat | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/windows/service-install.bat b/windows/service-install.bat index 8649781b..6a66b18c 100755 --- a/windows/service-install.bat +++ b/windows/service-install.bat @@ -1,6 +1,8 @@ -@SFC 2>&1 | FIND /i "/SCANNOW" >NUL -@IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE -@GOTO ADMINTASKS +@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 @@ -10,12 +12,12 @@ EXIT :ADMINTASKS -@CD /d %~dp0 +CD /d %~dp0 -.\dnscrypt-proxy.exe -service install -.\dnscrypt-proxy.exe -service start +CMD.EXE /c "dnscrypt-proxy.exe -service install" +CMD.EXE /c "dnscrypt-proxy.exe -service start" -@ECHO "" -@SET /P _=Thank you for using dnscrypt-proxy! Hit [RETURN] to finish +ECHO "" +SET /P _=Thank you for using dnscrypt-proxy! Hit [RETURN] to finish EXIT diff --git a/windows/service-restart.bat b/windows/service-restart.bat index 0d873d1c..978abaab 100755 --- a/windows/service-restart.bat +++ b/windows/service-restart.bat @@ -1,6 +1,8 @@ -@SFC 2>&1 | FIND /i "/SCANNOW" >NUL -@IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE -@GOTO ADMINTASKS +@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 @@ -10,12 +12,12 @@ EXIT :ADMINTASKS -@CD /d %~dp0 +CD /d %~dp0 -.\dnscrypt-proxy.exe -service stop -.\dnscrypt-proxy.exe -service start +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 +ECHO "" +SET /P _=Thank you for using dnscrypt-proxy! Hit [RETURN] to finish EXIT diff --git a/windows/service-uninstall.bat b/windows/service-uninstall.bat index 860f9904..b1772783 100755 --- a/windows/service-uninstall.bat +++ b/windows/service-uninstall.bat @@ -1,6 +1,8 @@ -@SFC 2>&1 | FIND /i "/SCANNOW" >NUL -@IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE -@GOTO ADMINTASKS +@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 @@ -10,12 +12,12 @@ EXIT :ADMINTASKS -@CD /d %~dp0 +CD /d %~dp0 -.\dnscrypt-proxy.exe -service stop -.\dnscrypt-proxy.exe -service uninstall +CMD.EXE /c ".\dnscrypt-proxy.exe -service stop" +CMD.EXE /c ".\dnscrypt-proxy.exe -service uninstall" -@ECHO "" -@SET /P _=Thank you for using dnscrypt-proxy! Hit [RETURN] to finish +ECHO "" +SET /P _=Thank you for using dnscrypt-proxy! Hit [RETURN] to finish EXIT