How to get Windows system information?
tjgolden at gmail.com
Sun Jan 15 10:39:27 CET 2006
[posting through Google; not sure how it will format]
re info on WMI website: please note that the examples I
give no the WMI pages are *nowhere near* exhausting
what WMI can do. They don't even scratch the surface.
And I all too rarely add to them.
If you look around the net, you'll find absolutely loads
of recipes for doing things with WMI. And it's usually
easy to translate them into Python. So, for example,
Googling for WMI CPU load takes you straight to
which (after some fairly intrusive boilerplate stuff)
ends up selecting from Win32_Processor. So, in
c = wmi.WMI ()
for i in c.Win32_Processor ():
# gives, among other things, a LoadPercentage
Now, what the different fields mean sometimes requires
a bit more research. But the Microsoft WMI pages
sometimes hit the spot, and indeed, a search for
brings up this page:
with a useful snippet on using WMI events to monitor
And so on. By and large, whatever you can think of doing
with WMI, someone's done before. And if someone's done
it in VBS (or Perl, or whatever), we can do it in Python.
More information about the Python-list