Dim objFSO, objFile, objFolder

Set objFSO = CreateObject("Scripting.FileSystemObject")


'enumerate through the files in the folder

'we've been given, for each file, delete it.

For Each objFile In objFSO.GetFolder(strPath).Files

if objFile.Size < 1K then

objFile.Delete

end if

Next



Can someone tell me how to change the "If objFile.Size < 1K Then" to a valid
syntax. (I don't write scripts and this would work fine given a correct If
clause).

Thanks,

Dean S

Re: if objFile.Size < 1K then (syntax correction needed) by Bob

Bob
Sat Nov 11 13:35:17 CST 2006

Dean Slindee wrote:
> Dim objFSO, objFile, objFolder
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
>
>
> 'enumerate through the files in the folder
>
> 'we've been given, for each file, delete it.
>
> For Each objFile In objFSO.GetFolder(strPath).Files
>
> if objFile.Size < 1K then
>
> objFile.Delete
>
> end if
>
> Next
>
>
>
> Can someone tell me how to change the "If objFile.Size < 1K Then" to a valid
> syntax. (I don't write scripts and this would work fine given a correct If
> clause).
>
> Thanks,
>
> Dean S
>
>


I only have a hint for you: what's the "K" /supposed to/ mean?



Bob

Re: if objFile.Size < 1K then (syntax correction needed) by Franz

Franz
Sat Nov 11 14:10:31 CST 2006

Bob O`Bob wrote:

>> if objFile.Size < 1K then
>> Can someone tell me how to change the "If objFile.Size < 1K Then" to
>> a valid syntax. (I don't write scripts and this would work fine
>> given a correct If clause).
>
> I only have a hint for you: what's the "K" /supposed to/ mean?

you're SO cruel :), and I have 1024 reasons to feed this link.

http://en.wikipedia.org/wiki/Kilobit






Re: if objFile.Size < 1K then (syntax correction needed) by bob

bob
Mon Nov 13 09:24:32 CST 2006

did you really think your computer knew what "1K" meant?



"Dean Slindee" <slindee@charter.net> wrote in message
news:Mgp5h.56$LK7.4@newsfe05.lga...
> Dim objFSO, objFile, objFolder
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
>
>
> 'enumerate through the files in the folder
>
> 'we've been given, for each file, delete it.
>
> For Each objFile In objFSO.GetFolder(strPath).Files
>
> if objFile.Size < 1K then
>
> objFile.Delete
>
> end if
>
> Next
>
>
>
> Can someone tell me how to change the "If objFile.Size < 1K Then" to a
> valid syntax. (I don't write scripts and this would work fine given a
> correct If clause).
>
> Thanks,
>
> Dean S
>
>