Harden Windows service supervision
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
cd /d "%~dp0"
|
||||
|
||||
powershell -NoProfile -Command "if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { exit 0 } else { exit 1 }" >nul 2>&1
|
||||
if not "%ERRORLEVEL%"=="0" (
|
||||
set "DOCUTRANSLATE_DIAGNOSE_BAT=%~f0"
|
||||
echo [INFO] Administrator permission is required. Opening the UAC prompt...
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath $env:DOCUTRANSLATE_DIAGNOSE_BAT -Verb RunAs"
|
||||
exit /b
|
||||
)
|
||||
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0diagnose_service.ps1"
|
||||
|
||||
echo.
|
||||
pause
|
||||
Reference in New Issue
Block a user