Hi, I'm looking to list all file names (including
hidden) in a directory that are greater than
X amount of meg in size (plus list the size),
and also to list any files in sub directories
that meet the same criteria. Have looked
through the forum but can only find examples
of when looking at just an individual file,
not directory contents.TIA
Lithium

for /f "tokens=* delims= " %%a in ('FOLDER\*') do (
if %%~Za gtr SIZE echo %%a is bigger than SIZE
)I only Batch if possible, 2000 more lines of code, oh well.
Dude, Cheers for the speedy reply but I replaced
FOLDER with Stuff (the folder name) and get :'Stuff\*' is not recognized as a operable
program or batch file.Am I being thick, sorry DOS not my thing! =)
OoOps, lol. I am so used to text parsing I put in the /f "...." by mistake :) Heres a working, TESTED, version.
@echo off
for %%a in ("FOLDER\*") do (
if %%~Za gtr SIZE echo %%a is %%~Za
)I only Batch if possible, 2000 more lines of code, oh well.
Sweet =), so my next question is; could it
also then list files within Sub-directories
of FOLDER\ as well? Wot you thought u had
betta things to do ;) lol
@echo off & setLocal EnableDelayedExpansion pushd c:\files
for /f "tokens=* delims= " %%a in ('dir/b/s') do (
if %%~Za gtr 30000 echo %%a is %%~Za
)for /f "tokens=* delims= " %%a in ('dir/b/s/ah') do (
if %%~Za gtr 30000 echo %%a is %%~Za
)
=====================================
If at first you don't succeed, you're about average.M2
