The following VBScript lists all installed hot fixes on windows one by one. The VBScript should be working on Windows Scripting Host, meaning that you need to use cscript.exe or wscript.exe to interpret the script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ' List Installed Hot Fixes 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 |
' List Installed Hot Fixes 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
The output on my M900 Lenovo Think Station Windows 10 64-bit is:
Computer: DESKTOP-H21RFPE Description: Update Hot Fix ID: KB3140741 Installation Date: Installed By: NT AUTHORITY\SYSTEM Computer: DESKTOP-H21RFPE Description: Update Hot Fix ID: KB3140743 Installation Date: Installed By: NT AUTHORITY\SYSTEM Computer: DESKTOP-H21RFPE Description: Security Update Hot Fix ID: KB3140768 Installation Date: Installed By: NT AUTHORITY\SYSTEM Computer: DESKTOP-H21RFPE Description: Security Update Hot Fix ID: KB3163207 Installation Date: Installed By: NT AUTHORITY\SYSTEM Computer: DESKTOP-H21RFPE Description: Security Update Hot Fix ID: KB3156421 Installation Date: Installed By: NT AUTHORITY\SYSTEM
The essence of the VBScript is to create the WMI service object. The power of VBScript is its simple syntax but flexibility in using COM objects.
–EOF (The Ultimate Computing & Technology Blog) —
Last Post: How to Prevent Script Running from Browsers?
Next Post: How to List Memory Devices in VBScript?