:: dont type out cmds in cmd window @echo off set CustPython=R:\Pipeline\App_Win\Python27x64\ :: Check for Python Installation python --version 2>NUL if errorlevel 1 goto NoPython ::====== hasPython ====== call python.exe %~dp0%~n0.py %1 && goto done goto console ::====== noPython ====== :NoPython IF EXIST %CustPython% ( echo %CustPython% call %CustPython%python.exe %~dp0%~n0.py %1 && goto done goto console ) ELSE ( echo Error^: Python not detected ) :console pause :done