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
For a 1 liner:
dir /a:d /b C:\Windows 2>&1 | findstr /i /n /c:"File Not Found">nul && (@echo. Im a file) || (@echo. Im a folder)
e.g. change C:\Windows to C:\Windows\Notepad.exe
C:\Windows
C:\Windows\Notepad.exe
-Sorry Arun, dbenham, didn't read yours! Same as..