I'm looking for a batch or any type of script (CMD/POWERSHELL) that can count files from folders and subfolders with directives.
My files structure is:
C:\Users\XXX\Desktop\TASK\YEAR-MONTH\TaskID\MP4
I need to count the files in every MP4
folder. I tried few scripts that I found around but nothing helps since it counts every single .mp4
in every subfolder and that's not the number I'm looking for.
The current script I'm using:
dir /b *.mp4 /s 2> nul | find "" /v /c > tmp && set /p count=<tmp && del tmp && echo Videos Found: %count%
The batch file should be dropped in the YEAR-MONTH folder and count everything from the MP4 subfolder inside the TaskID folder.
Note: There are 100+ TASKID (Real case when task id
is actually task id: 3130
) structures (3130/mp4/
) <- I need to count .mp4
files in this subfolder going inside every task folder.
I know this is overcomplicated and I would be happy if someone can pull this off!
Regards.