Enumerating Installed Hot Fixes

Microsoft® Windows® 2000 Scripting Guide

A hot fix is a temporary operating system patch produced by the Quick Fix Engineering group at Microsoft. Like service packs, hot fixes represent changes that have been made to a version of Windows after the operating system has been released.

Unlike service packs, hot fixes are not intended for blanket installation on all computers. Instead, they are developed to address very specific problems, often for specific computer configurations. For example, the hot fix 278438 should be installed only on computers running the Japanese version of Windows 2000 and Adobe PageMaker 6.53 and using a PostScript printer.

In addition, hot fixes represent independent installations that do not depend on other released hot fixes. For example, a hypothetical hot fix 4 would not include the bug fixes and functionality included in hot fixes 1, 2, and 3. In most cases, there would also be no requirement that you install hot fixes 1, 2, and 3 before installing hot fix 4. This makes enumeration of individual hot fixes an important administrative task: to know the exact configuration of a computer, you need to know not only which service packs have been installed but also which individual hot fixes have been installed.

The Win32_QuickFixEngineering class enables you to enumerate all the hot fixes that have been installed on a computer. Table 8.11 lists some of the hot fix properties that can be returned using the Win32_QuickFixEngineering class.

Table 8.11 Win32_QuickFixEngineering Properties

Property

Description

CSName

Local name of the computer system.

Description

Description of the hot fix.

HotFixID

Unique identifier associated with a particular hot fix.

InstallDate

Date the hot fix was installed.

InstalledBy

Person who installed the update.

Scripting Steps

Listing 8.9 contains a script that enumerates the installed hot fixes on a computer. To carry out this task, the script must perform the following steps:

  1. Create a variable to specify the computer name.

  2. Use a GetObject call to connect to the WMI namespace root\cimv2, and set the impersonation level to "impersonate."

  3. Use the ExecQuery method to query the Win32_QuickFixEngineering class.

    This query returns a collection consisting of all the hot fixes installed on the computer.

  4. For each hot fix installed on the computer, echo the values for properties such as hot fix description, hot fix ID, and the date the hot fix was installed.

Listing 8.9 Enumerating Installed Hot Fixes

  
1
2
3
4
5
6
7
8
9
10
11
12
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
 Wscript.Echo "Computer: " & objQuickFix.CSName
 Wscript.Echo "Description: " & objQuickFix.Description
 Wscript.Echo "Hot Fix ID: " & objQuickFix.HotFixID
 Wscript.Echo "Installation Date: " & objQuickFix.InstallDate
 Wscript.Echo "Installed By: " & objQuickFix.InstalledBy
Next