| 1. |
Solve : Find and delete file size? |
|
Answer» Hi all, Hi thanks for that, but then how do i delete those files?what requirements have you not stated yet? Code: [Select]Set objFS = CreateObject("Scripting.FileSystemObject") strFolder = "C:\test" Set objFolder = objFS.GetFolder(strFolder) For Each Files In objFolder.Files If objFS.GetExtensionName(Files) = "doc" Then If Files.Size > 10000 Then WScript.Echo "File " & Files.Name & " found." objFS.DeleteFile(Files) End If End If Next Quote from: ghostdog74 on April 26, 2008, 10:52:41 AM what requirements have you not stated yet? Original post Quote it looks into folder and delete .png files IF the size is below 10kb. [rolls eyes] @dias, yes i saw that in the original post thank you. I am asking OP what other requirements he has not stated yet, besides deletion of files.Hi, Thanks spot-on guys, thanks you your help. Cheers IanJust a point, 10 KB (file size) is conventionally 10 x 1024 bytes = 10240 bytes. it would depend on how OP wants it. A file with size 10239 bytes for example will not be deleted. |
|