DIR | FINDSTR Syntax file size query

Trying to search local drive for all files that are over certain byte size.   (Win7 64 CMD Prompt)

This nearly does what I want except it displays files smaller than than 10,000,000 bytes:

D:\>dir /a-d /o-s /n /-t /s| findstr /i [##,###,###]
13/01/2010  04:09 AM        39,312,785 Setup.exe
07/07/2005  01:36 AM         1,377,856 AutoRun.exe   >  I only want to view files with byte size over 10,000,000
               4 File(s)     39,690,748 bytes

This is what I thought should be correct syntax but it just hangs console hosts and displays lots of garbage until I kill conhost.exe

D:\>dir /a-d /o-s /n /-t | findstr /i /c:" *\[##,###,###\]" *
>No results

What am I doing wrong here? Is there a better way of doing this?

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve KnightIT ConsultancyCommented:
I think what you are looking for is

@echo off
dir /a-d /o-s /n /-t | findstr /v "Dir(s) File(s)" | findstr /r "[0-9][0-9],[0-9]*,[0-9]*"

though we can also do it by scanning down the files using a for loop if needed to get more info. etc.

Add a /s to the dir for subdirs too. but as it stands it won't tell you the foldername


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT ConsultancyCommented:
BTW I have a script here on my site which gives you the 20 largest files in a structure which is where I would start amending a script to just pull out all the > 10Mb ons:

FreezingPeteAuthor Commented:
Legend, spot on.

I want to create an alias which runs the command to display largest files in directories searched ... I know there are explorer plugins to do so though I'd rather stick with the cli if possible.
Will use your script and modify as required, thanks heaps. The penny has certainly dropped after seeing your syntax!
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Steve KnightIT ConsultancyCommented:
I had to think about it for a minute myself, hadn't thought of doing it that way before either!

No problem, and if you need any more you know where we are.

FreezingPeteAuthor Commented:
Cool, thanks.
Now I'm thinking along the lines of;
Tree listing of directories and files > dir.out
File search and string filter > filter.out
delete strings in filter.out from dir.out
File search and string filter >> filter.out

! Somehow getting the corresponding large file sizes displayed to the right of the files.

Then I plan on running it batch file from an alias which will display directories containing large files and what they are called.

In my case I know the particular areas I want to search, it just saves a lot of seeiing where.
Steve KnightIT ConsultancyCommented:
A good question.... if you want to raise a Q for this we can always work through it (and plenty of other good people here too under Windows Batch / MSDOS area best probably).

Rather than using the dir output you can use a FOR command and get the file sizes etc. for each file along the way, it kinda depends on the number of files involved (i.e. a file server shared area is going to take a while to process), what the criteria are etc. but of course 'anything' is do-able.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.