I am trying to write a script where I have to list all the folders inside a folder with the following logic:
Say folder A, B, C are inside folder F and A, B and C contain subfolders and files.
I have to write a script that would show the Folder A, B , C as header and then lists the files above a specified size inside them(including subfolders)... if possible with their modified date.
I have prepared a skeleton.
@echo off & setLocal EnableDelayedExpansion pushd C:\F
for /f "tokens=* delims= " %%a in ('dir/b/a:d') do (
echo %%a >>C:\F\list.txt
echo "-----------------------------------------------">>C:\F\list.txt
pushd %%a
for /f "tokens=* delims= " %%i in ('dir/b/s') do (
echo %%i >>C:\F\list.txt
if %%~Za gtr 10000 echo %%i is %%~Za >>C:\F\list.txt
))
The the desired output is:
Directory A
file1 size1 date1
file2 size2 date2
Directory B
file3 size3 date3
file4 size4 date4
Directory C
file5 size5 date5
file6 size6 date6
---date field is not mandatory but better if included.
Thanks & Regards