I searched here, found someone using this
set is_dir=0 for %%i in (\"%~1\") do if exist \"%%~si\"\\nul set is_dir=1
but didn\'t work, when
The /ad option for "dir" command lists folders, /b option for bare. Assuming you have checks for the existence of file in place, use:
dir /ad /b ChangeThisToYourFilename 1> NUL 2> NUL if %ERRORLEVEL% EQU 0 ( echo is a file ) else ( echo is NOT a file )