Skip to content

Instantly share code, notes, and snippets.

@glego
Created February 19, 2022 20:47
Show Gist options
  • Save glego/323e42dcb0e281487c18280336f00a94 to your computer and use it in GitHub Desktop.
Save glego/323e42dcb0e281487c18280336f00a94 to your computer and use it in GitHub Desktop.
@echo off
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 )
nssm edit nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment