Page 1 of 1 1
Topic Options
#167658 - 2006-09-14 05:32 PM Total Drive Space without WMI?
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
Hi there

Is there a way to get the total Drive Space of a drive without accessing the WMI?

greets
meta
_________________________
-=If you absolutly believe you can make up talent with hard work, there is no limit to what you can't achieve.=-

Top
#167659 - 2006-09-14 05:54 PM Re: Total Drive Space without WMI?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Just a quick search...
Is it this what you are looking for?
Enumerating Disk Space on a Computer

Top
#167660 - 2006-09-14 06:06 PM Re: Total Drive Space without WMI?
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
Not really, as i need an alternative for exactly for that which works by not using the WMI at all
Top
#167661 - 2006-09-14 06:12 PM Re: Total Drive Space without WMI?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
You are right, that's using WMI.
Why no WMI? (maybe some more info makes me think of other possibilities...)

Top
#167662 - 2006-09-14 06:22 PM Re: Total Drive Space without WMI?
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Just threw this together... requires WSHPipe(). Only tested with XP, so I can't be sure it works 100% with other OSs.
Code:
 
? diskspace("C:")
 
function $diskspace($drive)
dim $lines
$lines=wshpipe('%comspec% /c dir ' + $drive + '\',1)
$diskspace=join(split(split(trim($lines[ubound($lines)-1])," ")[3],","),"")
endfunction



{edit: Dang it... jumped the gun again... I thought you wanted free space... not total.}


Edited by Allen (2006-09-14 06:25 PM)

Top
#167663 - 2006-09-14 06:23 PM Re: Total Drive Space without WMI?
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
tbh, it's because we have some systems here with WINNT using WMI, and we still a couple of those machines here (not my fault) and i seek for an alternative to installing that wmi-core on all of those machines, 'cause i can't really get that working

Edit: Allen, Freespace ain't the problem, that's what GetDiskSpace is for


Edited by private_meta (2006-09-14 06:32 PM)
_________________________
-=If you absolutly believe you can make up talent with hard work, there is no limit to what you can't achieve.=-

Top
#167664 - 2006-09-14 06:50 PM Re: Total Drive Space without WMI?
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
MSInfo32 may also work, but there is something lingering in the cob-webs of my head, that it relys on WMI too... anyway you might be able to use this and then get the info out of the text/report file it generates.

Code:
"C:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32" /categories +ComponentsStorage /report c:\storage.txt 


Top
#167665 - 2006-09-14 06:53 PM Re: Total Drive Space without WMI?
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Have been googling a bit. I can find you in no time the Windows Management Instrumentation (WMI) CORE 1.5 (Windows 95/98/NT 4.0) installer and a bunch of code using WMI. But what you're asking... I get the impression that WMI was born for your question, and before that, there was nothing...
Top
#167666 - 2006-09-14 09:15 PM Re: Total Drive Space without WMI?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11628
Loc: CA
Well on XP you have FSUTIL - you might be able to copy it to NT and use it, have not tried.

Then run something like this.

fsutil volume diskfree c:

It should return something like this:

Total # of free bytes :
Total # of bytes :
Total # of avail free bytes :

He wants the middle spec.

Top
#167667 - 2006-09-15 05:32 AM Re: Total Drive Space without WMI?
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
Heya,

If it helps, here's a little util to return the total drive size of a drive. usage:

DriveSize [[X:] [/comma]]

parameters (in any order)
X: - the drive to check, valid input is a..z, colon must be present. If missing, C: is assumed

/comma - formats the output as 123,456,789 bytes. If missing output is 123456789 bytes.

If the drive doesn't exist (or is an empty CDROM) program returns -1

The output can be > to a file and read by kix, should be plenty of UDFs for that.

cj

Top
#167668 - 2006-09-15 10:25 AM Re: Total Drive Space without WMI?
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
Allen: The MSINFO32-Stuff does not work on the NT-Workstations,

To All others: Actually i wanted to get it working without installing or copying anything additionally onto these workstations.
It doesn't seem it's working out without install, so i'll just try that 1.5 core :/
_________________________
-=If you absolutly believe you can make up talent with hard work, there is no limit to what you can't achieve.=-

Top
#167669 - 2006-09-15 10:42 AM Re: Total Drive Space without WMI?
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Private, well - perhaps you should investigate about installing wmi on those machines - would only help you if you can do it.
Top
#167670 - 2006-09-15 11:06 AM Re: Total Drive Space without WMI?
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
that is what i'm about to try out now...
Top
#167671 - 2006-09-15 11:10 AM Re: Total Drive Space without WMI?
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
oh... Good luck with it (my head didn't wanna come along to work today...)
Top
Page 1 of 1 1


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

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.069 seconds in which 0.027 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