WMI Code Creator deserves a place on your hard drive
If you’ve looked into Windows Management Instrumentation (WMI) before then you’ll probably know that it’s a powerful Microsoft technology with a lot of useful system management capabilities, ideal for creating scripts to report on your current system state, or tweak it in just about any way you like.
But it’s also, well, a huge topic. And often highly technical. Even if you’re an expert developer, wading through the various namespaces, classes, methods and more will probably make your head hurt.
Fortunately there is an alternative, which won’t have you reaching for the aspirin. Quite the contrary: the WMI Code Creator is so straightforward that even non-developers will be able to get at least something from it.
To get started, click the “Query for data…” tab, and choose a class which looks interesting: Win32_ComputerSystem, say.
The “Results” tab will list 58 properties, which are items relating to that class which WMI can tell you about. And many of these look like just the kind of system information details that you might need to display in a script, if only occasionally: Domain, Manufacturer, Model, NumberOfProcessors, PowerManagementCapabilities, TotalPhysicalMemory, UserName, Workgroup, and the list goes on.
Browse the list and click on a few items you’d like to be displayed by your script: UserName and Workgroup, say. Hold down Ctrl if you’re selecting more than one, and as you click the program automatically generates and displays the appropriate VBScript for you.
And you don’t even have to run it yourself. Just click “Execute Code” and a command window will open where you can view the results. (Depending on your security software’s tolerance for running scripts, anyway.)
While this is all very easy, it’s just the start of the WMI Code Creator’s capabilities. Developers can also use the program to browse the namespaces on the current PC, execute methods, receive events and more, with code being optionally generated in VBScript, VB.Net or C#.
And that’s not bad at all for a free portable tool which is a mere 121KB download.
The WMI Code Creator isn’t a complete solution, of course. Go to execute a method, for instance, and you’ll often have to pass some parameter where you’ve no idea what it means, and so you’ll have to head off to a bulky online reference in order to find out more.
The program does provide a very quick and easy way to explore the power of WMI, though, and if you’ve any interest in the topic, or scripting and system management in general, then it’s well worth a place on your hard drive.