Skip to content

Instantly share code, notes, and snippets.

@glego
Created February 19, 2022 20:45
Show Gist options
  • Save glego/27a82684c9ae047945882e2fb96d6a7d to your computer and use it in GitHub Desktop.
Save glego/27a82684c9ae047945882e2fb96d6a7d to your computer and use it in GitHub Desktop.
@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