cd xyz_ --test >> nonExisting :if ![nonExisting] echo The folder does not exists (OK) :if [nonExisting] echo The folder exists (Fail) cd ..\files --test >> existing :if ![existing] echo The folder does not exists (Fail) :if [existing] echo The folder exists (OK)