Page 1 of 1 1
Topic Options
#8559 - 2001-05-09 04:28 PM Memory and Hard Drive Space
Anonymous
Unregistered


I'm working on getting a hardware inventory and am almost there but am having trouble capturing the memory and hard drive space.

Anyone have a successful script bit they can give me.

Many thanks.

Top
#8560 - 2001-05-09 09:10 PM Re: Memory and Hard Drive Space
Rush LaRue Offline
Fresh Scripter

Registered: 2001-04-24
Posts: 9
Loc: Huntsville, AL
; Get Disk Space on C:
if exist("c:\")
$ds=getdiskspace("c:\")
if ($ds/1024)<500 ;If freespace < 500M
$nul=messagebox("Only "+$ds+"MB of free space on C:","Report",4144)
endif
endif

------------------------------------------

As far as the memory count, I have not seen anything that didn't involve piping the information from a shelled program.

[This message has been edited by Rush LaRue (edited 09 May 2001).]

Top
#8561 - 2001-05-09 09:22 PM Re: Memory and Hard Drive Space
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

For memory and the way of gettings information about drives see our programs and topics memory.kix and mappings.kix.
You will find them on our site:
http://home.wanadoo.nl/scripting .
Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#8562 - 2001-05-25 07:18 PM Re: Memory and Hard Drive Space
Anonymous
Unregistered


Thanks for the input everyone.
The script is working wicked good except for the error message that is pumped out when launching into winmsd ("Network stats unavailable"). I actually don't care about this error and would just like to shut the error box down quickly so that the end loser doesn't read it and get concerned.

I will post the script at the end of this message for reference on this question and for anyone else who is sludging through inventory for W2k rollout purposes.

-----------Hardware Inventory Script-------
$disk=getdiskspace("c:\")
$disk
" bytes"
;**** define dump file and write KIX @macro output to it
$file="c:\batch\test\mylog.txt"

writeprofilestring("$file", "@wksta", "UserName", "@userid")
writeprofilestring("$file", "@wksta", "IP", "@ipaddress0")
writeprofilestring("$file", "@wksta", "MAC", "@address")
writeprofilestring("$file", "@wksta", "FreeSpace", "$disk")
writeprofilestring("$file", "@wksta", "DomPrivs", "@priv")
; ******** Query WINMSD section *************
go "C:"
SHELL 'CMD /X/C "WINMSD /S /F"'
OPEN(1, "@curdir\@WKSTA.TXT")=0
$counter=0
;**************************************
$LINE=READLINE(1)
WHILE @ERROR=0 and $counter<>2
IF INSTR($LINE,"Physical Memory")
$counter=$counter+1
$LINE=READLINE(1)
;$PMlabel=len("Physical Memory")
$memory=$LINE
ENDIF
IF INSTR($LINE,"Drives Report")
$counter=$counter+1
$LINE=READLINE(1)
$LINE=READLINE(1)
$total=instr($line,"Total:")
$free=instr($line,"KB"+chr(44)+" Free:")
$tot=substr($line,$total+7,$free-$total-7)

endif
$LINE=READLINE(1)
LOOP
$cl=CLOSE(1)
;endif
$exe=readvalue("$hklmhd","SystemBiosDate")
; Check BIOS
$ver=readvalue("$hklmhd","SystemBiosVersion") ; Check BIOS Version
$mhz=readvalue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0","~MHz")
$ven=readvalue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0","VendorIdentifier")
$ven2=readvalue("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0","Identifier")
; Check CPU maker
writeprofilestring("$file", "@wksta", "UserName", "@userid")
writeprofilestring("$file", "@wksta", "IP", "@ipaddress0")
writeprofilestring("$file", "@wksta", "MAC", "@address")
writeprofilestring("$file", "@wksta", "FreeSpace", "$disk")
writeprofilestring("$file", "@wksta", "DomPrivs", "@priv")


$wri=Writeprofilestring("$file","@wksta", "SystemBiosDate","$exe")
$wri=Writeprofilestring("$file","@wksta", "SystemBiosVersion","$ver")
$wri=Writeprofilestring("$file","@wksta", "ProcessorSpeed","$mhz")
$wri=Writeprofilestring("$file","@wksta", "VendorIdentifier","$ven")
$wri=Writeprofilestring("$file","@wksta", "VendorIdentifier","$ven2")
$wri=Writeprofilestring("$file","@wksta", "PhysicalMemory","$memory")
$wri=Writeprofilestring("$file","@wksta", "C: Drive Size","$tot")

Top
#8563 - 2001-05-27 09:35 AM Re: Memory and Hard Drive Space
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Last time we are reading many questions about the command winmsd.
A command which can be used for determining your local drive configu-
ration. Drive configuration which are visible for current operating
system. CPU speed for some operating systems.
A problem occurs when you doesn't have a network connection and when
you aren't running a NT system.

Mostly we want to have programs which run in BATCH mode and create
a little text file. Output in a window box is unusable and reques-
ted input is unwanted. Programs must run without user intervention
and must create a little text file.
For hardware components:


  • cpu speed + processor type
  • local and remote disk information
  • amount of memory

we are using such programs. They are FREEWARE.
See topic for more information:

Those programs returns one or more variables, which can be use in other
parts of your scripts.
Greetings.

------------------
Site map:

[This message has been edited by MCA (edited 27 May 2001).]

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 581 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.051 seconds in which 0.024 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