MSN Home  |  My MSN  |  Hotmail
Sign in to Windows Live ID Web Search:   
go to MSNGroups 
Groups Home  |  My Groups  |  Language  |  Help  
 
Windows-Scriptwindowsscript@groups.msn.com 
  
What's New
  Join Now
  Home  
  Windows XP  
  Getting Started  
  Advanced Stuff  
  FAQ  
  Downloads  
  
  COM Objects  
  
  MS Downloads  
  
  MS Scripts  
  
  Sample Code  
  
  Documentation  
  
  Utilities  
  
  MOF Files from the Microsoft Scripting Guy's  
  
  Comparomatic  
  
  Runomatic  
  
  Tweakomatic  
  Recommendations  
  MS Newsgroups  
  Upload  
  Old Homes  
  
  
  Tools  
 

Download http://groups.msn.com/windowsscript/Documents/Utilities%2Fmof%5Ffiles.zip

We have a collection of little .MOF files we thought we would send you (.MOF files, as you know, are the files used to define WMI classes). We were fooling around trying to write .MOF files that pulled information out of the registry, and we came up with at least one (software.mof) that we think is actually pretty useful. Software.mof allows you to retrieve information about MOST of the software installed on a computer, including everything (well, with a possible exception or two) that shows up in Add/Remove Programs. As you know, WMI has a class -- Win32_Product -- that shows you a list of installed software, but only if that software was installed using a .MSI file. This little baby goes beyond that.

(How does it work? It's actually pretty simple; it just grabs information out of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall portion of the registry.)

Anyway, we thought this was useful (people are always asking how they can write a script to do this), so we thought we'd pass it along and see what you think. To install it, copy software.mof to a folder and then, from the command prompt, type this:

        mofcomp software.mof

Within seconds you should see a message saying that software.mof was successfully loaded into the WMI repository. (Note: We know this works on Windows XP and Windows 2003. It should work elsewhere, but we haven't tested it. What if it DOESN'T work? Then it's no big deal; the compilation will fail, but that's it.)

After you've mofcomped software.mof, you should be able to run software.vbs and get more information than you could ever want about the software installed on a computer. Give it a try and see.

Of course, having done something once, we then had to see if we could do it a few more times. We're not sure how useful any of these other .MOF files are, but we've also included:

Profiles.mof -- Returns information about the user profiles found on a computer.

Components.mof -- Returns information about ActiveX controls and other components installed on a computer.

MMC_Snapins.mof -- Returns information about all the MMC snap-ins on a computer.

Connection_Manager.mof -- Returns information about all the Connection Manager connections on a computer.

We're not sure how much demand there is for these things but, hey, they're free, right? (One thing I should point out: All of these return information, but it might not be obvious to you what that information means. To tell you the truth, it's not necessarily obvious to us, either. We don't have anything at the moment to help you interpret all of the data, but if people find these things useful, we'll definitely put something together.)

To use any or all of these things, just mofcomp the appropriate file, e.g.:

        mofcomp mmc_snapins.mof

And let us know if you find them useful.

Oh, yeah: these are unsupported, use at your risk, we assume no responsibility for them, etc. You know the drill by now.

Greg Stemp
Microsoft Scripting Guy

Notice: Microsoft has no responsibility for the content featured in this group. Click here for more info.
  Try MSN Internet Software for FREE!
    MSN Home  |  My MSN  |  Hotmail  |  Search
Feedback  |  Help  
  ©2005 Microsoft Corporation. All rights reserved.  Legal  Advertise  MSN Privacy