I'm writing a inventory script for a mixed bag of OSs (win98,NT,2k). One hang up I have right now is determining the amount of memory installed for win98,winNT. I've done all my development on win2k, and initially used msinfo32.exe with the /report and /categories command switches (see below). After parsing the output. I get all kinds of cool info; System Brand, System Model, and of course Total Memory.
Much to my dismay I found that winnt/win98 don't have command line switches for msinfo32.
In a previous post, someone gave the solution of mem /c. However this doesn't tell you how much total physical memory is installed. Just the amount of DOS memory available.
So my question is. Has anyone out there written a script that reports the amount of physical memory for winNT and or win98?
Thanks in advance
heres a portion of my win2k part of the inventory script. I hope it comes out readable.
;get lots of cool information from msinfo if running win2k
if ($os = "win2k")
$msinfo = readvalue("HKEY_LOCAL_MACHINE\software\Microsoft\shared tools\msinfo", "path")
$string = "$msinfo "
$string2 = CHR(47)+"report c:\summary.txt "+CHR(47)+"categories +SystemSummary"
shell "$string$string2"
$string3 = "type c:\summary.txt "+CHR(62)+" summary2.txt" ;converts the output of sysinfo to regular text
shell "$string3"
$dummy = open (1, "c:\summary2.txt")
$x = 0
while ($x < 29)
$y = readline(1)
select
case $x = '8'
$os = substr($y,9,50)
case $x = '9'
$version = substr($y,9,50)
case $x = '12'
$sysbrand = substr($y,21,50)
case $x = '13'
$sysmodel = substr($y,14,50)
case $x = '22'
$tzone = substr($y,11,50)
case $x = '23'
$memory = substr($y,23,50)
endselect
$x = $x + 1
loop
$dummy = close (1)
endif