Creating a Custom Object with WSC
(Page 1 of 4 )
In my last article I introduced the Windows Script Components technology as a means of creating your own custom COM objects without the need for high level programming or expensive development software. I also showed you how to build a basic object shell using nothing but a text editor and the scripting knowledge you already possess. Today, we’ll take all of that a step further and get our hands dirty creating a real, working object with all of the bells and whistles.
I’m going to assume you read my last article, “Introducing Custom Objects with WSC.” If you haven’t, you’ll still be able to follow along with this article, but you’ll be missing out on some very important information. Be sure to take the time to read that article as well.
Let’s jump right in. The quickest way to create a Windows Script Component is by using Microsoft’s Windows Script Component Wizard. The wizard is an intuitive tool that will output a basic WSC file for you based on your requirements. It’s by far the fastest way to begin putting one of these together. It also generates the unique GUID you’ll need if you plan on registering your object (which you probably do). Of course, if you don’t plan on doing that, you can simply use the basic file layout that I presented in my last article.
Whether you chose to use the WSC Wizard or not, you’ll need some basic information. We’re going to be creating a component that will allow us to create and manipulate Compressed Folders. You can use any name you like or you can use the ones I’ll be providing by copying them from the image below. The first screen of the wizard should look something like this:

The only real important one here is the Prog ID. You’ll need to remember this for when you use your component later on. In my case, I’m using the ZipFolder.WSC Prog ID, so I’ll instantiate my object like this in my scripts:
Set objZipFolder = CreateObject("ZipFolder.WSC")
Next: Using the Script Component Wizard >>
More Code Examples Articles
More By Nilpo