DOS: if exist

@echo off

REM #######################
REM # Set Object Value
REM #######################

SET filename=D:\temp\test.bat
SET RETURN_MSG=

REM #######################
REM # Check object exist
REM #######################

if exist %filename% goto FOUND
SET RETURN_MSG=MESSAGE: Object not found
goto NOTFOUDN


:FOUND
SET RETURN_MSG=MESSAGE: Object found
echo %RETURN_MSG%
goto EXITOUT

:NOTFOUDN
echo %RETURN_MSG%
goto EXITOUT


:EXITOUT