advance dirlisting output

October 8, 2010 at 04:42:57
Specs: Windows Vista
I've got a script to check if folders have files in them or not.
It's scripted as following:
dir /A-D <DIR>| findstr /V /I Volume >> %LOG%
dir /A-D <DIR>| findstr /V /I Volume >> %LOG%
dir /A-D <DIR>| findstr /V /I Volume >> %LOG%

and that a lot more (about 200...)

With /V /I Volume added to filter out

Volume in drive * has no label
Volume Serial Number is ****-****

then %LOG% gets printed so we can check the containing folders for files which are too old.
But this always generates a result even if there are no files in the folder.
Now i want the output to be only written to %LOG% when there ARE files in the containing folder.
How to do?

See More: advance dirlisting output

Report •

October 8, 2010 at 08:57:21
for %%J in ("<DIR>\*") do @echo.%%~tJ  %%~zJ  %%~J >> %LOG%

Where <DIR> is your folder. Replace %%~J with %%~nxJ to output the filename without its path.

Report •
Related Solutions

Ask Question