I have a batch file that lists the contents of several directories to a
text file:
Dir ..\abc >> f:my.txt
Dir ..\def >> f:my.txt
Dir ..\ghi >> f:my.txt
IF the directories are empty I have extra stuff I do not want (it is
printed later). What I am looking for is a simple way to not even
execute the dir command if the directory is empty (they all do exist).
TIA
LB
Dir /A-D
returns errorlevel 1 if current directory contains 0 file(s).
How about...
Dir ..\abc /A-D >NUL 2>&1 && Dir ..\abc >> f:my.txt
:
:
HTH
--
Frank-Peter Schultze <fpsch...@my-deja.com>, http://www.fpschultze.de
Thanks
Will try ASAP
LB