Understanding Objects (Page 1 of 4 )
An object is an abstract term used to describe a set of methods, properties, and events that have a similar or related purpose. These pieces are typically intended to work together and are distributed as such.
Objects can also represent instances of applications or code that execute outside of the current program or script. An object reference allows you to interact with this outside program. The outside program or script must be written with this support.
From a programming standpoint, an object is simply defined as a class reference. This reference must be imported into your current script. Regardless of the language you choose to use—whether VBScript, Jscript, or some other—there is a method for connecting to these objects.
Languages that support the use of objects are known as object-oriented languages. These include languages such as VBScript, Jscript, Perl, and C++ to name a few. Any of the scriptable languages can be used in WSH so long as you have added support for it.
We’re going to be looking at a specific set of languages known as COM enabled. Since these objects, or classes, need to be distributed to every computer that runs a script, it was deemed appropriate to preload Windows with a set of the most commonly used objects. This set of native objects is collectively known as the Common Object Model, or COM.
Most COM objects come in the form of ActiveX controls.
COM has many types of objects intended for many different applications. Some are more complex than others. In order to use a COM object in WSH, it must have a scripting interface. This means that it must have been designed to allow scripts to access it. We’ll discuss this in more detail later in this article.
For now, understand that objects allow you to execute code that is outside of your current script.
Next: What objects provide >>
More Windows Scripting Articles
More By Nilpo