Hi all,

If I create a FileSystemObject Object is it appropriate to reuse it to
perform operations on different files/folders?

Or should I create a new FileSystemObject Object for each file and folder?

--
Sean.

Re: Reusing FileSystemObject Object by Bob

Bob
Wed Oct 12 06:12:37 CDT 2005

Sean S - Perth, WA wrote:
> Hi all,
>
> If I create a FileSystemObject Object is it appropriate to reuse it to
> perform operations on different files/folders?
>
Sure. Try it.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: Reusing FileSystemObject Object by Phill

Phill
Wed Oct 12 06:23:43 CDT 2005

<Sean S - Perth>; "WA" <SeanSPerthWA@discussions.microsoft.com> wrote in
message news:431D3569-3E2C-46CA-863F-307C71A8B000@microsoft.com...

> If I create a FileSystemObject Object is it appropriate to reuse it to
> perform operations on different files/folders?

Yes, absolutely.

In fact, I took it as far as creating a function that returns me an
instantiated FileSystemObject, rather than creating it myself in all
the odd little functions I might want to use it, as in

Dim g_oFSO ' as FileSystemObject
Set g_oFSO = Nothing

Function FSO() ' as FileSystemObject
If g_oFSO Is Nothing Then
Set g_oFSO = CreateObject( "Scripting.FileSystemObject" )
End If
Set FSO = g_oFSO
End If

HTH,
Phill W.