I would like to process all the files in a folder staring with the biggest.
I didn't found any property that I can use to specify this order to the
Folder.Files collection
I use ( form memory
dim fs as new Filesystemobject
dim fldr as Folder
dim F as File
set flder = fs.GetFolder("c:\.....")
for each f in fldr.files
'process F
' I want the biggest first then the other in desc order
next
Quoting from VBScript documentation:
Size Property
For files, returns the size, in bytes, of the specified file. For
folders, returns the size, in bytes, of all files and subfolders
contained in the folder.
object.Size
The object is always a File or Folder object.
Documentation (compiled html download)
http://msdn.microsoft.com/scripting/windowshost/wshdoc.exe
http://msdn.microsoft.com/scripting/vbscript/download/vbsdoc.exe
Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/
Const adVarChar = 200, adBigInt = 20
Set fso = CreateObject("Scripting.FileSystemObject")
Set rsFiles = CreateObject("ADODB.Recordset")
rsFiles.Fields.Append "Path", adVarChar, 255
rsFiles.Fields.Append "Size", adBigInt
rsFiles.Open
For Each F In fso.GetFolder(".").Files ' your path here
rsFiles.AddNew
rsFiles("Path") = F.Path
rsFiles("Size") = F.Size
Next
rsFiles.Sort = "Size DESC"
Do Until rsFiles.EOF
Set F = fso.GetFile(rsFiles("Path"))
' Process F
WScript.Echo F.Name, vbTab, FormatNumber(F.Size, 0, True)
rsFiles.MoveNext
Loop
=-=-=
Steve
-=-=-
"Etienne Charlier" <Etienne....@advalvas.be> wrote in message
news:3aca25e2$0$27807$456d...@news.skynet.be...
Etienne
"Steve Fulton" <cerbe...@hotmail.com> wrote in message
news:#n7XbQIvAHA.2160@tkmsftngp02...