ChrisPro
11 years agoContributor
RAM and processor information
Hello, I would like to display in log : - RAM information - processor information Thanls for your answer.
- 11 years agoHi Chris,
For CPU information, use Sys.CPU and Sys.CPUCount.
For the memory size, use the WMI class Win32_PhysicalMemory. You'll need to sum the Capacity property values of all class instances:
function PrintTotalMemoty()
{
var oWMI = GetObject("winmgmts:");
var memSize = 0;
var colItems = oWMI.ExecQuery("SELECT Capacity FROM Win32_PhysicalMemory");
var enumItems = new Enumerator(colItems);
for ( ; !enumItems.atEnd(); enumItems.moveNext())
{
memSize += aqConvert.StrToFloat(enumItems.item().Capacity);
}
Log.Message("Total physical memory: " + VarToStr(memSize) + " bytes");
}