1. Home
  2. Computing & Technology
  3. Visual Basic

VBScript - The System Administrator's Language - Part 3

By Dan Mabbutt, About.com

3 of 5

Inside Scriptomatic

The heart of the Scriptomatic VBScript processing is very similar to the template presented in Part 2. Here's code directly from Scriptomatic:

~~~~~~~~~~~~~~~~~~~~~~~~~
strComputer = "."
Set objWMIService = GetObject( _
    "winmgmts:{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set objClass = objWMIService.Get(ClassesPulldown.Value)
...
...(statements to display results omitted)
...
For Each objProperty in objClass.properties_
    strHTML = strHTML & "    _
    Wscript.Echo " & chr(34) & objProperty.name & _
    ": " & chr(34) & " & " & "objItem." & _
    objProperty.name & Chr(10)
Next
~~~~~~~~~~~~~~~~~~~~~~~~~

The bulk of the Scriptomatic code is there to select the objects and handle the results. Although you're encouraged to download it and loook through the code yourself, it is some reasonably complex scripting so we won't go into it in detail here -- except for --

HTA

When you run Scriptomatic, what you'll see is a web page, not a traditional script. Microsoft has coded Scriptomatic as an HTA (HTML Applications), which elevates VBScript waaaay above the "quick and dirty" level.

Let's check out what an "HTA" actually is next ...

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB 6
  5. Learn VBScript
  6. VBScript - The System Administrator's Language - Part 3

©2009 About.com, a part of The New York Times Company.

All rights reserved.