To check if a file exists:
To check if a directory exists (Notice the nul):
IF EXIST c:\windows\win.com ECHO File exists!
Note if working with long directory names with spaces, then one needs to put quotes around the directory-/file-path (Notice that nul should not be included):
IF EXIST c:\windows\nul ECHO Directory exists!
More Info MS KB65994
IF EXIST "C:\Program Files\" ECHO Directory exists!