diff --git a/service_install.bat b/service_install.bat index e97cd01..122284d 100644 --- a/service_install.bat +++ b/service_install.bat @@ -4,13 +4,13 @@ chcp 65001 > nul :: 65001 - UTF-8 :: Admin rights check -net session >nul 2>&1 -if %errorLevel% neq 0 ( +if "%1"=="admin" ( + echo Started with admin rights +) else ( echo Requesting admin rights... powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs" exit /b ) -if "%1"=="admin" echo Started with admin rights :: Main cd /d "%~dp0" diff --git a/service_remove.bat b/service_remove.bat index e9c092e..5256a93 100644 --- a/service_remove.bat +++ b/service_remove.bat @@ -2,13 +2,13 @@ chcp 65001 > nul :: 65001 - UTF-8 -net session >nul 2>&1 -if %errorLevel% neq 0 ( +if "%1"=="admin" ( + echo Started with admin rights +) else ( echo Requesting admin rights... powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/k \"\"%~f0\" admin\"' -Verb RunAs" exit /b ) -if "%1"=="admin" echo Started with admin rights set SRVCNAME=zapret