@echo off net session >nul 2>&1 if not "%errorlevel%"=="0" ( powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs" exit /b ) powershell -NoProfile -ExecutionPolicy Bypass -File "C:\PF\vm-start.ps1" if errorlevel 1 pause