Created
February 19, 2022 20:45
-
-
Save glego/27a82684c9ae047945882e2fb96d6a7d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
IF "%NGINX_DIR%"=="" SET NGINX_DIR=%~dp0 | |
set "params=%*" | |
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~dp0"" && ""%~0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B ) | |
PsExec64.exe -s "%NGINX_DIR%\nginx.exe" -p %NGINX_DIR% -s reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment