| View previous topic :: View next topic |
| Author |
Message |
david.kingham
Joined: 06 Nov 2007 Posts: 24
|
Posted: Tue Oct 14, 2008 10:52 pm Post subject: Report Physical RAM installed |
|
|
I need my script to simply read how much physical ram is installed, this is what I've come up with so far is this
| Code: | Run msinfo32.exe /categories +SWEnvStartupPrograms /report C:\test.txt
FileReadLine RAM, C:\test.txt, 25
StringTrimLeft RAM, RAM, 22
StringTrimRight RAM, RAM, 7
MsgBox %RAM% |
Simple enough, but it seems as though the txt file that msinfo creates is encrypted or something, if I read the first line I just get weird characters. If I create a new txt file and paste in the same text from the original file it will read the new file just fine.
Is there any easier way to go about this? |
|
| Back to top |
|
 |
Guest
|
|
| Back to top |
|
 |
david.kingham
Joined: 06 Nov 2007 Posts: 24
|
Posted: Tue Oct 14, 2008 11:17 pm Post subject: |
|
|
| That doesn't seem to report the RAM correctly, says I have 4TB...I don't think so, only 12GB |
|
| Back to top |
|
 |
david.kingham
Joined: 06 Nov 2007 Posts: 24
|
Posted: Thu Oct 16, 2008 2:56 pm Post subject: |
|
|
| bump |
|
| Back to top |
|
 |
daonlyfreez
Joined: 16 Mar 2005 Posts: 949 Location: Berlin
|
|
| Back to top |
|
 |
david.kingham
Joined: 06 Nov 2007 Posts: 24
|
Posted: Thu Oct 16, 2008 5:34 pm Post subject: |
|
|
That has potential but it also reports the ram incorrectly, I have 12gb and it says this: Available Physical Ram: 4194304k
Possibly something to do with XP64? Or am I missing something very obvious with some sort of conversion? |
|
| Back to top |
|
 |
evan Guest
|
Posted: Thu Oct 16, 2008 5:40 pm Post subject: |
|
|
i remember when my friend bought his new sony laptop (which has 4GBram)
and its only displaying 3GB ram on system
the sales person told him to update/install something in order for the computer to recognized there are 4GB ram
so it might similar in ur case
the method u use to output will not recognized something over 4GB |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Thu Oct 16, 2008 8:03 pm Post subject: |
|
|
| Code: | ; http://www.autohotkey.com/forum/viewtopic.php?p=225823#225823
VarSetCapacity( MEMORYSTATUSEX,64,0 ), NumPut( 64,MEMORYSTATUSEX )
DllCall( "GlobalMemoryStatusEx", UInt,&MEMORYSTATUSEX )
TotalPhys := NumGet( MEMORYSTATUSEX,8,"Int64"), VarSetCapacity( PhysMem,16,0 )
DllCall( "shlwapi.dll\StrFormatByteSize64A", Int64,TotalPhys, Str,PhysMem, UInt,16 )
; StrFormatByteSize64 : http://msdn.microsoft.com/en-us/library/bb759971(VS.85).aspx
MsgBox, 64, Total Physical Memory, %TotalPhys% Bytes`n= %PhysMem%
/*
GlobalMemoryStatusEx : http://msdn.microsoft.com/en-us/library/aa366589(VS.85).aspx
Requires Windows Vista, Windows XP, or Windows 2000 Professional.
typedef struct _MEMORYSTATUSEX {
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
*/ |
_________________ URLGet - Internet Explorer based Downloader |
|
| Back to top |
|
 |
david.kingham
Joined: 06 Nov 2007 Posts: 24
|
Posted: Fri Oct 17, 2008 3:01 pm Post subject: |
|
|
| That works brilliantly, thank you sir. |
|
| Back to top |
|
 |
|