To All:

I am inclined to believe that if you are running a rather complex
VBScript, that you should clear the objects in order to get better
performance.

Is this true?

I have found that if I remove software thus:

set objWMIService = GetObject ("Winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & _
"\root\cimv2")
set colSoftware = wbjWMIService.ExecQuery _
("Select * from Win32_Product Where Name = 'Yahoo Instant _
Messenger'")
For Each objSoftware in colsoftware
objSoftware.Uninstall()
Next

Let's say that I have 3 conditional 'IF/Then' statements all using
objSoftware and colSoftware.

Does it give better performance if I clear out the objects by setting
them to nothing so that I can have a better chance of everything
running?

Mark

Re: Clearing Objects in VBSCript by mayayana

mayayana
Wed Jun 14 20:08:31 CDT 2006

You mean each objSoftware? Those are
part of the colsoftware collection. I'm not
certain, but I assume they're handled
automatically when the colsoftware object
is released.

As for the objects that you've set, that's a hot
topic that's been fully covered at least once recently.
You might want to search the group for
setting + nothing

You can also read just about every angle on theat
topic here:

http://blogs.msdn.com/ericlippert/archive/2004/04/28/122259.aspx

It's a blog page that consists of a slightly hysterical
anti-nothing rant by an MS scripting expert. The blog
comments that follow it cover pretty much every
notable argument for and against his position.


>
> I am inclined to believe that if you are running a rather complex
> VBScript, that you should clear the objects in order to get better
> performance.
>
> Is this true?
>
> I have found that if I remove software thus:
>
> set objWMIService = GetObject ("Winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & _
> "\root\cimv2")
> set colSoftware = wbjWMIService.ExecQuery _
> ("Select * from Win32_Product Where Name = 'Yahoo Instant _
> Messenger'")
> For Each objSoftware in colsoftware
> objSoftware.Uninstall()
> Next
>
> Let's say that I have 3 conditional 'IF/Then' statements all using
> objSoftware and colSoftware.
>
> Does it give better performance if I clear out the objects by setting
> them to nothing so that I can have a better chance of everything
> running?
>
> Mark



Re: Clearing Objects in VBSCript by Mark

Mark
Thu Jun 15 10:23:39 CDT 2006

On 2006-06-15, mayayana <mayaXXyana1a@mindXXspring.com> wrote:
> You mean each objSoftware? Those are
> part of the colsoftware collection. I'm not
> certain, but I assume they're handled
> automatically when the colsoftware object
> is released.
>
> As for the objects that you've set, that's a hot
> topic that's been fully covered at least once recently.
> You might want to search the group for
> setting + nothing
>
> You can also read just about every angle on theat
> topic here:
>
> http://blogs.msdn.com/ericlippert/archive/2004/04/28/122259.aspx
>
> It's a blog page that consists of a slightly hysterical
> anti-nothing rant by an MS scripting expert. The blog
> comments that follow it cover pretty much every
> notable argument for and against his position.

Thank you for the reply!

Mark