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

VBScript - The System Administrator's Language - Part 3

By , About.com Guide

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

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. 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

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

All rights reserved.