Open-AudIT https://www.open-audit.org/phpBB3/ |
|
Memory under "System Summary" zero for Vista https://www.open-audit.org/phpBB3/viewtopic.php?f=8&t=2300 |
Page 1 of 1 |
Author: | jpmorgan [ Tue Aug 07, 2007 7:40 am ] |
Post subject: | Memory under "System Summary" zero for Vista |
Win32_LogicalMemoryConfiguration is depreciated in XP. It doesn't exist in WIndows Vista, so under "System Summary - Memory," nothing is listed for Vista. According to Microsoft (http://msdn2.microsoft.com/en-US/library/aa394181.aspx) Win32_OperatingSystem should be used instead. So instead of using Win32_LogicalMemoryConfiguration - TotalPhysicalMemory we should use Win32_OperatingSystem - TotalVisibleMemorySize. On XP you will notice that both contain the same information. Below is the code I used to fix mine. I left in the Win32_LogicalMemoryConfiguration section in case there are compatibility issues. I'm not sure exactly when Win32_OperatingSystem - TotalVisibleMemorySize was added. In audit.vbs under "System Information & Timezone" replace everything before the "Win32_ComputerSystem" section with this code: [code] ''''''''''''''''''''''''''''''''''''' ' System Information & Timezone ' ''''''''''''''''''''''''''''''''''''' comment = "System Info" if verbose = "y" then wscript.echo comment end if On Error Resume Next Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalMemoryConfiguration",,48) mem_count = 0 For Each objItem in colItems mem_count = mem_count + objItem.Capacity Next if mem_count > 0 then mem_size = int(mem_count /1024 /1024) else 'Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalMemoryConfiguration",,48) For Each objItem in colItems mem_size = objItem.TotalPhysicalMemory Next If isempty(mem_size) Then Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48) For Each objItem in colItems mem_size = objItem.TotalVisibleMemorySize Next End If mem_size = int(mem_size /1024) end if[/code] Can someone verify this information is correct? I also commented out the following line: [code]'Set colItems = objWMIService.ExecQuery("Select * from Win32_LogicalMemoryConfiguration",,48)[/code] The same line is directly above, so it seems redundant to me. |
Page 1 of 1 | All times are UTC + 10 hours |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |