@echo off setlocal set "SCRIPT_DIR=%~dp0" set "PS_SCRIPT=%SCRIPT_DIR%caffeine.ps1" if not exist "%PS_SCRIPT%" ( echo Could not find "%PS_SCRIPT%". exit /b 1 ) powershell.exe -NoProfile -ExecutionPolicy Bypass -STA -File "%PS_SCRIPT%" %* exit /b %ERRORLEVEL%