@echo off :: Check whether the script is running as Administrator net session >nul 2>&1 if %errorlevel% neq 0 ( echo Requesting Administrator privileges... powershell -Command "Start-Process '%~f0' -Verb RunAs" exit /b ) :: ================================================== :: ADMINISTRATOR CMD STARTS HERE :: ================================================== echo. echo ========================================== echo Running with Administrator privileges echo ========================================== echo. :: Your commands go here whoami echo. echo Current directory: %CD% echo. :: Example commands: :: ipconfig :: sfc /scannow :: netsh ... :: your-other-command mrt cmd /k