Page 1 of 1 1
Topic Options
#44577 - 2003-08-28 02:01 PM Memory
Noia Offline
Lurker

Registered: 2003-08-28
Posts: 1
Got a little script going to dump HW and SW info on workstations, but I seem to be unable to find one pice of information.

I want to find out how many of the Memory banks are filled and how many are empty, it is the last bit which has be puzzled.

Hope some one can give me an answer or code snippit, thank you.

- Noia

Top
#44578 - 2003-08-28 02:05 PM Re: Memory
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Noia,

Welcome to the wonderful world of KiXtart scripting!

To help you, please utilize the search function in our UDF Forum to look for WMIQUERY.. This will show you a pretty slick script to do what you are asking for.

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#44579 - 2003-08-28 02:15 PM Re: Memory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
here is WMIQuery

think I saw a ready script here some year ago too...
_________________________
!

download KiXnet

Top
#44580 - 2003-08-28 02:31 PM Re: Memory
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
code:
 
$dimms =WMIQuery("Capacity","Win32_PhysicalMemory")
for $a=0 to ubound($dimms)
$=execute("$$dimm$a=val($$dimms[$a]) / 1048576")
$=execute("$$memory=val($$Memory)+val($$dimm$a)")
next

? $dimm0 $dimm1 $dimm2 $dimm3
? $memory



[ 28. August 2003, 14:33: Message edited by: Radimus ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44581 - 2003-08-28 02:46 PM Re: Memory
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Nice one.
One little question.

Quits with Expected expression! at line 0.

[Confused]

kix = 4.21
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#44582 - 2003-08-28 02:49 PM Re: Memory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
eh.
for each $dim in WMIQuery("Capacity","Win32_PhysicalMemory")
(0+$dim)/1048576 "MBytes" ?
next
_________________________
!

download KiXnet

Top
#44583 - 2003-08-28 02:51 PM Re: Memory
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
what ver of wmiquery()?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#44584 - 2003-08-28 02:51 PM Re: Memory
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
lol.
if you look at it, there is the WMIquery used that was pointed to you.
you need to have that UDF in your script file to be able to use it.
_________________________
!

download KiXnet

Top
#44585 - 2003-08-28 03:04 PM Re: Memory
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
OK, a little new to WMI en UDF's but learning each day.

If I correctly understand Lonkero's post the WMIquery() UDF is required for the code to run properly?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#44586 - 2003-08-28 03:05 PM Re: Memory
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
read the FAQ on how to use UDFs
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.074 seconds in which 0.038 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org