Computer Hope

Microsoft => Microsoft Windows => Windows XP => Topic started by: Valerie on July 01, 2010, 03:58:23 PM

Title: Print registry extract.
Post by: Valerie on July 01, 2010, 03:58:23 PM
Win XP Pro SP.3

How can I print a listing of hotfixes installed since SP.3 from the registry?

Thanks.
Title: Re: Print registry extract.
Post by: Sidewinder on July 01, 2010, 05:27:25 PM
Instead of mucking around in the registry, Windows Management Instrumentation (WMI) abstracts the data in the Win32_QuickFixEngineering class. You can access this data with a Windows script:

Code: [Select]
' List Installed Hot Fixes

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colQuickFixes = objWMIService.ExecQuery _
    ("Select * from Win32_QuickFixEngineering WHERE HotFixID <> 'File 1'")

For Each objQuickFix in colQuickFixes
    Wscript.Echo "Computer: " & objQuickFix.CSName
    Wscript.Echo "Description: " & objQuickFix.Description
    Wscript.Echo "Hot Fix ID: " & objQuickFix.HotFixID
    WScript.Echo "Installed On: " & objQuickFix.InstalledOn
    Wscript.Echo "Installed By: " & objQuickFix.InstalledBy
    WScript.Echo ""
Next

Save the code with a VBS extension and run from the command prompt as
cscript scriptname.vbs. You can redirect the output to your printer, or a file and then print it.

It was an arbitrary choice of fields to display. A complete list of data fields available can be found here (http://msdn.microsoft.com/en-us/library/aa394391%28VS.85%29.aspx).

Good luck.  8)
Title: Re: Print registry extract.
Post by: Valerie on July 01, 2010, 11:10:49 PM
Thank you Sidewinder - exactly what I wanted.

V.