@echo off cd /d "%~dp0" if exist "%~dp0pythonw.exe" (start "" "%~dp0pythonw.exe" main.py & exit /b 0) where pythonw >nul 2>nul && (start "" pythonw main.py & exit /b 0) where pyw >nul 2>nul && (start "" pyw -3 main.py & exit /b 0) where py >nul 2>nul && (py -3 main.py & exit /b 0) python main.py