I\'m testing the existence of a folder, and, depending on its existence, I want to run different commands:
DIR %MYDIR%\\tmp > test.txt IF ERRORLEVEL 1 (
Use exist instead:
exist
@echo off if exist %MYDIR%\tmp ( dir %MYDIR%\tmp > test.txt goto EndIt ) echo %MYDIR%\tmp not found > test.txt :EndIt