Re: How do I get the PC's Processor speed?



On Nov 6, 2007 1:18 PM, <kyosohma@xxxxxxxxx> wrote:
Hi,

We use a script here at work that runs whenever someone logs into
their machine that logs various bits of information to a database. One
of those bits is the CPU's model and speed. While this works in 95% of
the time, we have some fringe cases where the only thing returned is
the processor name. We use this data to help us decide which PCs need
to be updated, so it would be nice to have the processor speed in all
cases.

Currently, this script is run on Windows boxes only, most of which
have Windows XP on them. Right now I am having Python check the
following registry key for the CPU info: HKEY_LOCAL_MACHINE\HARDWARE\
\DESCRIPTION\\System\\CentralProcessor\\0

I've also used Tim Golden's WMI module like so:

<code>

import wmi
c = wmi.WMI()
for i in c.Win32_Processor ():
cputype = i.Name

</code>

On the problem PCs, both of these methods give me the same information
(i.e. only the processor name). However, if I go to "System
Properties" and look at the "General" tab, it lists the CPU name and
processor speed. Does anyone else know of another way to get at this
information?


You'd want the MaxClockSpeed property. There's a few other clock speed
properties as well, see
http://msdn2.microsoft.com/en-us/library/aa394373.aspx.

MSDN should always be your first stop with WMI questions, by the way.
.



Relevant Pages

  • How do I get the PCs Processor speed?
    ... We use a script here at work that runs whenever someone logs into ... their machine that logs various bits of information to a database. ... following registry key for the CPU info: ... I've also used Tim Golden's WMI module like so: ...
    (comp.lang.python)
  • Re: Creating a session in windows to auth to remote machines
    ... I'm trying to auth to remote machines so I can plunder WMI to get ... logs and settings and the like. ... My script works for most of my ...
    (comp.lang.python)
  • RE: Does WMI have to be installed on Remote Computer?
    ... IMHO this looks like a well constructed and very vell commented script. ... WMI comes as standard on w2k w2k3 and xp, ... does WMI need to be installed on the remote computer in order for a ... ''' First try to ping the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: Look over this script.....could anything be done better?
    ... will be unable to connect with WMI. ... With this version of the script I have kept that included because the script that enumerates all of the servers has some servers that no longer exist. ... Dim objWMIService, colFixedDrives, objFD ...
    (microsoft.public.scripting.vbscript)
  • Re: Create simple file share on the fly
    ... WMI share routine faithfully works. ... You can place the command line below as the final line in your WMI ... You might experiment with actual workstations to see if the script is ... the shares that I make from the Windows GUI, ...
    (microsoft.public.windowsxp.security_admin)