advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the code for this article
What other information would be useful in the Compare Computers program? Tell us in the Windows NT/2000 forum.
Partners & Affiliates
advertisement
advertisement
advertisement
Rate this item | 0 users have rated this item.
Comparing Computer Information with WMI, Part II (cont'd)
Fixing the Inevitable
If you've worked extensively with Microsoft operating systems, you are familiar with Service Packs, and their smaller cousins, the Quick Engineering Fixes (QEF). Even with automatic notifications, it's hard enough to keep up with all the current QEFs for your own local computer. Determining whether all the computers on your network have the correct QEFs installed is an even more daunting task.
advertisement

Figure 3. The Fix Is In: If you swim in Microsoft's ocean, you need to keep up with not only the current service packs, but the post service pack quick-fixes. A simple registry call (run under WMI) will get you this information.
WMI has an object that exposes the QEFs installed on a computer—Win32_QuickFixEngineering. However, this method has at least two problems that I'm aware of. First, on a pre-SP3 version of W2K, it can cause the WinMgmt process to hang. This bug is fixed in a post SP2 QEF, and in SP3 for W2K. Also, the WMI object seems to incorrectly parse some of the QEF information (which is located in the registry), and provides duplicate data for many of the QEFs. I have provided the WMI version of the program with the GetHotFixData function. For safety, I've written a private method GetOS that uses the public GetOsData to determine if you are running W2K and if you are at SP3 or above (see the code below). If you fail these two tests, the function returns False so you can abort the call to WMI (if you don't abort the call, it might lock up the computer with 100% processor activity for WinMgmt).


Private Function GetOS_
(ByVal xi_sWbemServices As SWbemServices) As Variant
Dim vntTmp                          As Variant
Dim vntRtn                          As Variant
ReDim vntRtn(1 To 2) As Variant
vntTmp = GetOsData(xi_sWbemServices)
If Left$(vntTmp(1, 13), 4) = "5.0." Then
   If CLng(vntTmp(1, 25)) >= 3 Then
      vntRtn(1) = True
      vntRtn(2) = vbNullString
   Else
      vntRtn(1) = False
      vntRtn(2) = "If you are running W2K, _
	  you must have at least SP3 to run this " & _
	"method. You are running SP " & vntTmp(1, 25)
   End If
Else
   vntRtn(1) = True
   vntRtn(2) = vbNullString
End If
GetOS = vntRtn
End Function

I've also provided GetHotFixData2, which queries the registry directly (much as in the GetInstalledSoftwareData2). You can see the results in Figure 3. The code is very similar to the registry code for the installed software (download here).

The ways you can extend comparisons between two computers with WMI are extensive. I may revisit this program sometime in the future, but if you have any suggestions, please let me know.

Previous Page: What Does it Mean to Install?  


L.J. Johnson is the owner of Slightly Tilted Software in Dallas, Texas. He has been programming in Visual Basic since 1.0 and is a Microsoft Most Valuable Professional (MVP).
Page 1: IntroductionPage 3: Fixing the Inevitable
Page 2: What Does it Mean to Install? 
Please rate this item (5=best)
 1  2  3  4  5
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Help  |   Site Map  |   Network Map  |   About


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers