Code: Select all
set Dir?=for /l %%# in (1 1 2) do if %%#==2 (for /f "tokens=*" %%# in (!in!) do if not "%%~a#"=="d----------" color 11) else setlocal enabledelayedexpansion ^& set in=
Code: Select all
%Dir?%"c:\windows"
if %errorlevel%==0 (echo dir) else (echo file)