BAT 非右键方式以管理员身份运行批处理
@echo off & PUSHD %~dp0 & TITLE Run The BAT File As An Administrator mode con lines=4 cols=64 color 0A set BAT_UAC_DIR=%TMP% set BAT_UAC_NAME=%random%.vbs set BAT_UAC_FILE=%BAT_UAC_DIR%\%BAT_UAC_NAME% 1>NUL 2>&1 reg query "HKU\S-1-5-19" || ( echo set obj = CreateObject^("Shell.Application"^) >> "%BAT_UAC_FILE%" echo obj.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%BAT_UAC_FILE%" "%BAT_UAC_FILE%" del /A /F /Q "%BAT_UAC_DIR%\*.vbs" 2>NUL exit /B ) echo "OK" pause