Polenta Elevate - PElevate
Description
PElevate is a Windows utility that elevates batch files to administrator privileges using UAC (User Account Control). It automatically checks if running as admin and requests elevation if needed. Perfect for batch scripts that require administrator rights.
Platform: Windows 10/11 (x64)
License: Freeware
Version: 1.0.0
Features
PElevate provides seamless UAC elevation for your batch files:
-
Automatic Admin Detection
Checks if the current process is running with administrator privileges using the same method as standard batch file elevation scripts. -
Auto-Detect Batch File
When called with no arguments, automatically detects the calling batch file and elevates it. Perfect for simple usage: just addPElevate.exeat the top of your batch file. -
UAC Elevation
Uses PowerShell to request UAC elevation, restarting the batch file with administrator privileges if needed. -
Seamless Integration
Works exactly like traditional batch file elevation scripts, but as a standalone executable. No need to embed PowerShell commands in your batch files. -
Explicit File Support
Can also elevate specific batch files by path, useful for calling from other scripts or applications. -
Error Handling
Returns appropriate exit codes: 0 if already admin (batch continues), 1 if elevation successful (batch should exit and restart), 2 if elevation failed. -
Lightweight & Portable
No installation required! Just a single executable that's ready to use in your batch files. Zero dependencies. -
Quick Links (
-ws, --website/-don, --donate)
Open the Polenta Connection website or donate page directly from the command line.
Usage
PElevate.exe [options] [batch_file]
Examples
Simple usage in batch files (auto-detect):
@echo off
PElevate.exe
if %errorlevel% neq 0 exit /b
REM Your batch file code here...
ProgramThatNeedsElevation.exe
Explicit usage with batch file path:
PElevate.exe "%~f0"
if %errorlevel% neq 0 exit /b
REM Your batch file code here...
Elevate a specific batch file:
PElevate.exe -f script.batElevate and run script.bat
PElevate.exe script.batElevate and run script.bat (short form)
PElevate.exe -f script.bat -a arg1 arg2Elevate and run script.bat with arguments
How It Works
PElevate uses the same approach as traditional batch file elevation scripts:
-
Check Admin Status: Uses
net sessionto check if running with administrator privileges. - If Already Admin: Exits with code 0, allowing the batch file to continue execution.
-
If Not Admin: Uses PowerShell's
Start-Processwith-Verb RunAsto request UAC elevation and restart the batch file as administrator. Exits with code 1 to signal the original batch file should exit. - Elevated Restart: The batch file restarts with administrator privileges, PElevate detects it's already admin, and the batch file continues with full privileges.
Exit Codes
- 0: Already running as administrator (batch file continues)
- 1: Elevation successful (batch file should exit and will restart as admin)
- 2: Elevation failed (error occurred)