Try using this:
IF EXIST yourfilename (
echo Yes
) ELSE (
echo No
)
Replace yourfilename with the name of your file.
For a directory look at this https://jeffpar.github.io/kbarchive/kb/065/Q65994/
C:
IF NOT EXIST C:\WIN\ GOTO NOWINDIR
CD \WIN
:NOWINDIR
trailing backslash ('\') seems to be enough to distinguish between directories and ordinary files.