if exist "C:\MyFolder\MyFile.txt" exit /b 1001 exit /b 0