Use CMD.EXE /c to run Windows commands

That sounds very weird to me, but @mazesy said it was the right
thing to do.
This commit is contained in:
Frank Denis 2018-04-10 20:04:03 +02:00
parent 989de64cf9
commit e20c980b15
3 changed files with 30 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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