Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Check for admin privileges
- net session >nul 2>&1
- if %errorlevel% neq 0 (
- echo Requesting administrator privileges...
- powershell -Command "Start-Process '%~f0' -Verb RunAs"
- exit /b
- )
- :: Your main script starts here
- echo Running as administrator!
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement