Page 1 of 1 1
Topic Options
#80449 - 2001-10-30 12:12 AM Total Disk Space and CDROM
Anonymous
Unregistered


We need a total disk space and drive type macro! Inventory coolection would then be complete! Especially if you could add CPU type, speed, and installed memory so I do not have to use 3rd party utils.

[ 30 October 2001: Message edited by: Bill Bowker ]

Top
#80450 - 2001-10-30 01:18 AM Re: Total Disk Space and CDROM
MCA Offline
KiX Supporter
*****

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

A good idea, but we think it is not so easy to implement. New hardware requires new releases of software. You can see it with 3rd party utils.
Total diskspace calculation can be done in an easy way by kixtart. For us is dir command not a 3rd party utility.
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
#80451 - 2001-10-30 02:17 AM Re: Total Disk Space and CDROM
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
tools like WMI when used with kix4.0 can give you this information.

a small example.

code:

$drives = GetObject("WinMgmts:").InstancesOf("Win32_LogicalDisk")
for each $drive in $drives
? $drive.name
? "Total drive size = " + $drive.size
? "freespace = " + $drive.freespace
select
case $drive.drivetype = 0
? "Drive type = Unknown"
case $drive.drivetype = 1
? "Drive type = No Root Directory"
case $drive.drivetype = 2
? "Drive type = Removable Disk"
case $drive.drivetype = 3
? "Drive type = Local Disk"
case $drive.drivetype = 4
? "Drive type = Network Drive"
case $drive.drivetype = 5
? "Drive type = Compact Disc"
case $drive.drivetype = 6
? "Drive type = RAM Disk"
endselect
? ""
next



Top
#80452 - 2001-10-30 05:34 AM Re: Total Disk Space and CDROM
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Well hell.... here is Drives, CPU's and memory, using the WMI interface and Kix4.0.

code:

? "----===== Drives =====----"

$drives = GetObject("WinMgmts:").InstancesOf("Win32_LogicalDisk")
for each $drive in $drives
? $drive.name
? "Total drive size = " + $drive.size
? "freespace = " + $drive.freespace
select
case $drive.drivetype = 0
? "Drive type = Unknown"
case $drive.drivetype = 1
? "Drive type = No Root Directory"
case $drive.drivetype = 2
? "Drive type = Removable Disk"
case $drive.drivetype = 3
? "Drive type = Local Disk"
case $drive.drivetype = 4
? "Drive type = Network Drive"
case $drive.drivetype = 5
? "Drive type = Compact Disc"
case $drive.drivetype = 6
? "Drive type = RAM Disk"
endselect
? ""
next


? "----===== CPU's =====----"
$CPUs = GetObject("WinMgmts:").InstancesOf("Win32_Processor")
for each $cpu in $cpus
? $cpu.Manufacturer + ":" + $cpu.CurrentClockSpeed + "Mhz"

next

? "----===== Memory =====----"

$Memory = GetObject("WinMgmts:").InstancesOf("Win32_PhysicalMemory")
for each $mem in $memory
? $mem.Capacity + " bytes"
next



Top
#80453 - 2001-10-30 10:04 PM Re: Total Disk Space and CDROM
MCA Offline
KiX Supporter
*****

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

You see it is already there. Code is very simple. You only need to learn some object
programming.
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
#80454 - 2001-11-01 11:41 PM Re: Total Disk Space and CDROM
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Bryce,

Do you know what these values are based on? None of them are close to anything I have. The CPU was correct. The disk space might be right if you were to /1024 maybe? The RAM is way off both Physical as well as available the Cached memory was the only one right. The physical and swap combined still don't make what it says I have. Is there documentation somewhere that explains how this call is interpredted?

Top
#80455 - 2001-11-02 12:34 AM Re: Total Disk Space and CDROM
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
DOC,

i got all of that stuff out of the WMI SDK the other night. Aside from that.....?

Bryce

Top
#80456 - 2001-11-02 07:58 PM Re: Total Disk Space and CDROM
Anonymous
Unregistered


Great stuff, but what about Win9x machines?
Top
#80457 - 2001-11-05 09:17 AM Re: Total Disk Space and CDROM
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Just kick them off the desk on to the floor...

MCA has a script that can take care of this for you. Great stuff. The CPU is not very reliable though becuase of time slice issues that the auther knows about, but seems he appears to be gone from school now and not updating the program anymore. But the other stuff works good.

Thanks again for that kind of work MCA.

Top
#80458 - 2001-11-12 10:53 AM Re: Total Disk Space and CDROM
JonnyThunder Offline
Fresh Scripter

Registered: 2001-11-08
Posts: 11
MCA has a script that kicks windows 9x PC's off the desk and on to the floor? That's sweet. I'll have some of that....


Top
#80459 - 2001-11-12 04:52 PM Re: Total Disk Space and CDROM
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Just before you end out with kicking your Win9x machines out the window.

WMI works just as well on Win9x machines, just install the WMI-core.
The WMI-core has to be installed on all OS'es prior to W2K.

The same goes for the ADSI-inteface, this can also be installed on all platforms from Win95 and upwards.


Erik

Top
#80460 - 2001-11-13 07:03 AM Re: Total Disk Space and CDROM
MCA Offline
KiX Supporter
*****

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

We doesn't know what a script can do also. But we find out that some
manufactories doesn't support Windows 95 anymore. A simple installation
with own risk isn't possible. Even Microsoft programs doesn't always work in a correct way.
Same experience with new hardware.

Possible that everybody should migrate to Windows XP, which means:
- we can use it for a long time.
- new hardware and software will be compatible with this version also
for a long time.
- we have the possibility to find new problems and microsoft have the
challenge to fix them.
greetings.


btw: NTDOC, we will look at your remark about CPU.

_________________________
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:  Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1376 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.12 seconds in which 0.068 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