One on the things you always want to do when you create objects in your scripts, especially objects from third party companies is, is to always remember to destroy the objects when you are done with them. At the very least, before you exit the script.

Object creation and not destroy the objects can be one source of memory leaks. In order to destroy an object should use the object’s .dispose method. If it does not have a dispose method, you set simply it to a special value of nothing. This will destroy the object and free up it’s memory. An example of using nothing is shown below:

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Tony,
Excellent [A href="http://blogs.msdn.com/ericlippert/archive/2004/04/28/122259.aspx"]article on vbscript's memory management[/A] it expands on the topic and even claims that vbscript will automatically clear up itself when the object goes out of scope... but goes on to say if it's not broken why fix it.
Thanks for adding to the discussion... keep 'em coming!

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

About This Blog

Be lazy! Stop beating yourself to death doing redundant tasks. Script it instead! I’ll discuss VBScript, products and technologies that will make your life easier as a Microsoft Windows administrator. This blog covers a variety of topics such as IIS, Exchange, ISA, and other Microsoft services.