Solved Batch to Find Files w/specified ext in all subfolders & log

May 16, 2020 at 17:32:10
Specs: Windows 7, 32GB
Batch File To Find Files with specified extensions in all subfolders, larger than 40 MB

My working folder is e:\photos
It has 20 sub-folders.
I want to find all *.mp4 *.mpg *.mov *.wmv *.avi with a filesize > 40mb then list them with full path to log.txt

Original full path and file name.

Many thanks,
GregS


See More: Batch to Find Files w/specified ext in all subfolders & log

Reply ↓  Report •

#1
May 16, 2020 at 17:58:05
✔ Best Answer
@echo off
pushd e:\photos
(for /f "tokens=*" %%a in ('dir /s /b /a-d *.mp4 *.mpg *.mov *.wmv *.avi ') do if %%~za gtr 40000000 echo %%a)>log.txt
::---------- end
not rigorously tested. worked "offhand"

Reply ↓  Report •

#2
May 17, 2020 at 06:40:45
100% perfect, fast and clean. Thank you!!!

Reply ↓  Report •
Related Solutions


Ask Question