Previous Section Table of Contents Next Section

The Component Object Model (COM)

Software developers have always been encouraged to develop reusable code. Imagine that you created some piece of code that retrieves the TCP/IP settings of a remote computer. Many administrators might want to use that code again. So how do you make your code available to them in an easy-to-use way?

Microsoft's answer is COM, the Component Object Model. COM is a specification that describes how code can be packaged into objects, making them self-contained, easy (relatively speaking) to deploy, and easy for other developers to use. Physically, COM objects are usually implemented in DLL files-which, if you check out the contents of a Windows computer's System32 folder, should tell you how pervasive COM is!

VBScript is completely capable of utilizing COM objects. That's a powerful feature, because most of Windows' functionality-and most other Microsoft applications' functionality-is rolled up into COM components. Working with e-mail, Active Directory, Windows Management Instrumentation, networking, the registry, and more is all possible through COM components, and therefore through VBScript. I'll cover objects in more detail, including examples of how to use them in script beginning in Chapter 5, and show you how to really take advantage of them in Chapter 11.

VBScript is even capable of creating COM components. That means you can use VBScript to create your IP-retrieval software, package that software as a COM component, and distribute it to other administrators. This feature of scripting is called Windows Script Components. Chapter 25 is all about modular script programming, including Windows Script Components.

    Previous Section Table of Contents Next Section