That's a big question. First, WMI has nothing to
do with VBScript directly. It's a complete system
on it's own, with its own objects and syntax. WMI
just happens to be one tool that is accessible through
VBScript. If you don't have a copy of the WMI help
file you should try to find that. There used to be a
WMI SDK that could be downloaded, with samples and
a good help file. Looking around now I'm finding the
typical problem with getting Microsoft docs: The links
to the SDK are broken. Mentions of it only point to
the "download center", which is a generic MS download
page. A search there turned up nothing.
It may be that the WMI SDK, like some others, is now
only available as part of the giant Win32 platform SDK.
That presents some problems. First, you'll need a high
speed connection to get it. Then you probably have to
allow the install of Microsoft's "Windows Genuine Advantage"
spyware. Worse, MS created a new, incompatible help system
in their recent SDKs. I think they call it HTML Help 2. One
apparently needs Visual Studio 2008 to read the new help.
There's a free program called HelpExplorer that also seems to
work, but HelpExplorer can't provide a master index to the
large number of help files in the platform SDK.
The original help file, if you can find it, will be named
There's also a WMI group:
What you posted is VBScript using the FileSystemObject,
which is one of the many COM objects available to script.
There isn't really a master list of those. There are a handful
that are officially part of the Windows Script Host, such
as FSO, Dictionary, WScript.Shell, etc. Those objects are
in scrrun.dll and wshom.ocx. You can inspect those files with
an object browser. A free object browser is here: http://www.tlviewer.org/tlviewer/
To make a long story very short, COM objects are specifically
designed programming tools that are registered in the Registry.
Any number of objects can reside in a given PE file (exe, dll, ocx).
Part of the COM spec. is that these files also have a "type library" --
either internal or in an external file -- which describes the methods
and properties of objects. The type library makes a COM object
"self-describing". An object browser is basically a specialized
type library reader that allows you to see what objects are avaiaable
and what their methods are. (Though an object browser rarely
provides enough information to use an object. It's mostly sort
of a crib sheet for reference.)
In VBScript, using the CreateObject method, you can use
many of the COM objects registered on your system, thereby
expanding the abilities of VBS. Such objects are not inherent
to VBS itself. The object must be installed/registered on your
system in order to use it.
For the basic objects connected with WSH, like FSO, you
can look up the methods in the WSH help file. Then there are
objects like Shell.Application that are on nearly all Windows
systems (Shell.App. was added with Active Desktop/Win98), but
they're not official scripting objects so they're not in the help file.
Then there are automation objects, like Internet Explorer and
MS Word. You can use VBS with them. There are also various
3rd-party (non-Microsoft) components available.
So most of what VBS can do is derived from one object or
another, but objects can be all sorts of things.
> Can anyone explain the following:
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set a = fso.CreateTextFile("c:\testfile.txt", True)
> a.WriteLine("This is a test.")
> I get the code.. just that where do I find the FileSystemObject and
> others like it? I've been using WMI and looking in root/CIMV2.
> Please give me a quick difference between the two types.