How can I report CPU information like; Type, Speed, Load etc.
I use the memory function in AMS just fine just looking for more info.
Mark
Professional Software Development Tools
How can I report CPU information like; Type, Speed, Load etc.
I use the memory function in AMS just fine just looking for more info.
Mark
Well just a question you ask for type, but type of waht?? you mean the pocessor info??
Yes, Intel, AMD, Pent IV any info I can get from a system.
This link has a couple ways of accomplishing such:
http://www.indigorose.com/forums/sho...light=msinfo32
Sincerely,
Intrigued
There is no built-in variables for those things in AMS50. We have looked at doing that in the past but due to the fact that we need to support a wide range of operating systems and the different ways to get this information for different processors, it has not been feasible so far.
Thanks again for the quick responces.
You may also like to explore the below Registry Key:
[HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\Cen tralProcessor\0]
There is a wealth of reliable information that can be returned from this area
of the registry:
the value: ~MHZ if read by AMS will return the CPU Clock speed
(if the 'length' of returned string is 4 - then you are in the GigHz range)
the value: VendorIdentifier will return CPU manuafacturer
Above are present on Win2K and later..so could use the first two at least
not on all systems: ProcessorNameString
note: if system is 'Multi-threading' capable and has been Enabled in the BIOS
[HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\Cen tralProcessor\1]
is present also (or if genuine 'Dual Processors)
May come in handy for quick Cpu speed checking at least ..(and manufacturer
Last edited by SUF6NEWBIE; 12-10-2004 at 10:24 PM.
Here's some LUA code for AMS5 and SUF70
(tested on Win2k and later OSs only)
Returns a boolean as to whether 'required CPU specs' have been met
TO CALL IT ..say in startup actions..Code:function GetCPUSpecs() --test for Cpu Speed and Manufacturer --set some values for 'Min CPu speed' and 'Supported Manufacturer' local CpuMin = 500; --500 Mhz clock speed-minimum requirement local Man1 = "intel"; -- approved manufacturer target strings local Man2 = "amd"; -- " " " " bCpuspecsmet = false; -- set global initial value local strCpuRegKey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\\"; local CpuInfo_T = Registry.GetValueNames(HKEY_LOCAL_MACHINE, strCpuRegKey); --cycle valuenames for 'required' specifications for cpuindex, cpuvalue in CpuInfo_T do Dialog.Message("Debug info only: valuename-", cpuvalue); if (cpuvalue == "~MHz") then Cpuspec = String.ToNumber(Registry.GetValue(HKEY_LOCAL_MACHINE, strCpuRegKey, cpuvalue, true)); end if (cpuvalue == "VendorIdentifier") then Manspec = Registry.GetValue(HKEY_LOCAL_MACHINE, strCpuRegKey, cpuvalue, true); end end if (Cpuspec ~= "") and (Manspec ~= "") then if (Cpuspec >= CpuMin) then if (String.Find(Manspec, Man1, 1, false) ~= "-1") or (String.Find(Manspec, Man2, 1, false) ~= "-1") then Dialog.Message("Debug info only: returned Specs", "CPU clock speed:-"..Cpuspec.."\r\nManufacturer:-"..Manspec.."\r\n\r\nMin target Cpu speed:-"..CpuMin); bCpuspecsmet = true; end end end return bCpuspecsmet; end --GetCPUSpecs()
..there is also another value named: Identifier.Code:GetCPUSpecs(); -- will return true or false as below example: if (not bCpuspecsmet) then Dialog.Message("This Application Cannot Continue","Minimum Required System CPU Specifications were not met"); end if (bCpuspecsmet) then Dialog.Message("This Application Can Continue","Minimum Required System CPU Specifications Have been met"); end
(if you wish to include this one in above function..what you are looking for is
eG: Stepping 3)
as far as I am aware:
'Stepping 1' equates to Celeron -Amd Duron equiv
'Stepping 3' equates to PIII or equivelent
'Stepping 9' is one known value for PIV (with multi threading)
I anyone can confirm the 'stepping values' during testing let us know..
Please report if Code Functions reliably for your testing.
(so far so good at my end..)
..fiddle with the code if only wish to check for and or display CPu speed etc.
(supported manufacturer 'required' stuff --only if essential ?)
..if want to display CPu speed suggest checking if length of string is 4
then string.mid (first 2) then modify the string to show eg:
if value is 2411 for cpu speed , a 'user friendly' would be 2.4ghz or similar
Here's a 'safer' modifiaction ..only does CPu Check and provides a display string
works for Win2k and later(may work for Win98 -Me..hav'nt tested)Code:function GetCPUSpecs() bCpuspecsmet = true; local CpuMin = 500; --500 Mhz min req local strCpuRegKey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\\"; local CpuInfo_T = Registry.GetValueNames(HKEY_LOCAL_MACHINE, strCpuRegKey); for cpuindex, cpuvalue in CpuInfo_T do if (cpuvalue == "~MHz") then strCpuspec = Registry.GetValue(HKEY_LOCAL_MACHINE, strCpuRegKey, cpuvalue, true); if (String.Length(strCpuspec) == 4) then strcpumid = String.Mid(strCpuspec, 1, 2); CpuDisp = String.Left(strcpumid, 1).."."..String.Right(strcpumid, 1).." Ghz"; --display ready else CpuDisp = strCpuspec.." Mhz"; --display ready end Cpuspec = String.ToNumber(strCpuspec); break; end end if (Cpuspec < CpuMin) then bCpuspecsmet = false; elseif (strCpuspec == "") then CpuDisp = "No Data"; --display ready end return bCpuspecsmet; end --GetCPUSpecs
Thanks alot for the HELPFUL info. I didn't even think about the Registry.
Your code works fine on XP Pro SP2.
Thanks again.
noproblemo Mark...happy its doin its thing...tks for the confirmation
I didn't know, but are you sure? I could give my word that my old laptop was equipped with a Celeron processor, but the Registry has these data:Originally Posted by SUF6NEWBIE
"Identifier"="x86 Family 6 Model 6 Stepping 10"
"ProcessorNameString" = value does not exist
On the Intel site I found:
* The "family" and "model" information determines what kind of processor it is (Pentium® processor, Pentium® Pro processor, Pentium® II processor, etc.).
* The "stepping" of a processor can be compared to the "version" of a piece of software.
* Intel Pentium 4 processors have a Family value of "F"
I think 'value of F' means the hex value = decimal 15. At least my main computer returns:
"Identifier" = x86 Family 15 Model 2 Stepping 4
"ProcessorNameString" = Intel(R) Pentium(R) 4 CPU 2.40GHz
The old Intel Utility CPUID.exe displays:
This system has an unknown Genuine Intel processor with MMX(TM) technology
Processor Family: F / Model: 2 / Stepping: 4
Intel has some test apps at http://support.intel.com/support/pro.../CS-015477.htm
Thanks to the flexibility in both AMS50 and SUF70 (the LUA engine) it is possible to get the information you need (with the conditions that are suitable to your needs). But, what to do in another app without the capabilities of reading the Registry? Thanks to a previous link in this forum I use AutoIt . It's a really nice tool. You use Notepad to write a script file (.au3) like this:
You can compile the script to an exe file (with your own icon). In the attached example I write the info to an ini file which can be read by "the other app". Of course you can run the Env_info.exe from AMS and then read the ini file…Code:$Speed = RegRead("HKLM\Hardware\Description\System\CentralProcessor\0","~MHz") If $Speed <> "" Then $Speed = Round($Speed / 1000,1) & " GHz" Endif
My main computer has this output (Env_Info.ini, with Norwegian data labels, sorry):
[System]
WindowsVersjon=Windows XP 5.1.2600 Service Pack 2
Prosessor=Intel(R) Pentium(R) 4 CPU 2.40GHz
CPU Speed=2.4 GHz
CPU Identifier=x86 Family 15 Model 2 Stepping 4
My old laptop:
[System]
WindowsVersjon=Windows NT4 4.0.1381 Service Pack 6
Prosessor=x86 Family 6 Model 6 Stepping 10
CPU Speed=0.4 GHz <== Impressive!
CPU Identifier=x86 Family 6 Model 6 Stepping 10
A real OLD Compaq (with a 1.95 GB hard disk); from the trash dump)
[System]
WindowsVersjon=Windows 98 4.10.2222 A
Prosessor=Pentium(r) Processor
CPU Speed=
CPU Identifier=Pentium(r) Processor
It should be nice to have more reports about the "Family" issue.
Last edited by csd214; 12-13-2004 at 04:30 AM.
'If anyone can confirm the 'stepping values' during testing let us know..'
Thanks for all the Information CSD...yep the Proccessor 'Capabilities' I mentioned (stepping value) is obviously not reliable info...
It would be great if we could get basic CPU capability ....
Last edited by SUF6NEWBIE; 12-13-2004 at 07:54 AM.
It is all ok... but... can anyone help me to get my hard disk id....