Hello,

I am looking for a script that will copy a file that is not empty. I would
like for it to determine if the file is empty then if it is to skip to the
end and if it is not empty then copy it to another location.

Thank you for any input.

Re: Script to copy a file that is not empty by Owen

Owen
Fri Sep 07 16:55:14 PDT 2007

On Sep 7, 1:22 pm, Brian <Br...@discussions.microsoft.com> wrote:
> Hello,
>
> I am looking for a script that will copy a file that is not empty. I would
> like for it to determine if the file is empty then if it is to skip to the
> end and if it is not empty then copy it to another location.
>
> Thank you for any input.

Here is the general idea.

Dim fso, f, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("C:\Control\Logs\test.log")
s = UCase(f.Name) & " uses " & f.size & " bytes."
ShowFolderSize = s
msgbox s

If f.size <> 0 Then
f.Copy ("C:\Control\Logs\Notempty\test.log")
End If