Does anybody know how find all the files on a HD greater than > 10mb?

Re: file sizes by McKirahan

McKirahan
Wed May 25 15:11:03 CDT 2005

"Big D" <BigDaddy@newsgroup.nospam> wrote in message
news:umjsRbVYFHA.3712@TK2MSFTNGP09.phx.gbl...
> Does anybody know how find all the files on a HD greater than > 10mb?


A quick-and-dirty way is to do this

dir \ /a/s | find /v " " | sort > bigfiles.txt

It won't tell you the path, though.


Of course, you want a VBScript that will recurse
all folders on all drives (or a given drive)...



Re: file sizes by McKirahan

McKirahan
Wed May 25 15:17:48 CDT 2005

"McKirahan" <News@McKirahan.com> wrote in message
news:VuCdnWGbSu1KRgnfRVn-gA@comcast.com...
> "Big D" <BigDaddy@newsgroup.nospam> wrote in message
> news:umjsRbVYFHA.3712@TK2MSFTNGP09.phx.gbl...
> > Does anybody know how find all the files on a HD greater than > 10mb?
>
>
> A quick-and-dirty way is to do this
>
> dir \ /a/s | find /v " " | sort > bigfiles.txt
>
> It won't tell you the path, though.
>
>
> Of course, you want a VBScript that will recurse
> all folders on all drives (or a given drive)...
>


Make that:

> dir \ /a/s | find /v " " | find "," | sort > bigfiles.txt



Re: file sizes by Christoph

Christoph
Wed May 25 23:27:28 CDT 2005

25.05.2005 20:23, Big D schrieb:
> Does anybody know how find all the files on a HD greater than > 10mb?

Can be done with WMI


Option Explicit

Dim oSink, oWMI
Dim strResult, strDrive, intSizeMin, strWQL
Dim bDone, lngReturnCode

Execute "Const MB = " & (1024 * 1024)

strDrive = "D:"
intSizeMin = 10 * MB

strWQL = "Select FileSize, Name from CIM_datafile where DRIVE='" _
& strDrive & "' AND FileSize>" & (intSizeMin-1)

set oSink = WScript.CreateObject("wbemscripting.swbemsink", "AsyncExec_")
set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!//./root/cimv2")

oWMI.ExecQueryAsync oSink, strWQL
While Not bDone : WScript.Sleep 100 : Wend

WScript.Echo "ReturnCode:", lngReturnCode & ", Files Found:" & strResult

Sub AsyncExec_OnCompleted(hr, oErr, oContext)
lngReturnCode = hr : bDone = -1
End Sub

Sub AsyncExec_OnObjectReady(oObj, oContext)
strResult = strResult & vbcrlf _
& oObj.Name & " / " & FormatNumber(oObj.FileSize/MB, 2) & " MB"
End Sub



--
Gruesse, Christoph

Rio Riay Riayo - Gordon Sumner, 1979

Re: file sizes by Dr

Dr
Thu May 26 09:31:54 CDT 2005

JRS: In article <umjsRbVYFHA.3712@TK2MSFTNGP09.phx.gbl>, dated Wed, 25
May 2005 14:23:13, seen in news:microsoft.public.scripting.vbscript, Big
D <BigDaddy@newsgroup.nospam> posted :

Yes.

>Does anybody know how find all the files on a HD greater than > 10mb?

Ten millibytes is rather small.

HUNT \*.* s p q a z+10000000 Mcdef e

will list all files over 10000000 bytes on drives c d e f (which may be
on one HD).

HUNT *.* s p q z+1000000 e a | COLS 58- ` 2+12

will list all over 1000000 bytes in the current directory and its
subdirectories in the form of path-from-here\name.ext ; and with p+ it's
an absolute path.


HUNT, COLS, for DOS and compatible, via sig line 3 below.

Note that you asked for over 10 meg; you may have meant over 9999999 b.

You could translate it into VBScript?

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>.
Do not Mail News to me. Before a reply, quote with ">" or "> " (SoRFC1036)