Slickdeals is community-supported.  We may get paid by brands or deals, including promoted items.
Forum Thread

DOS Command to get total Disk Size?

1,655 36 March 14, 2005 at 11:27 AM
Does anyone know a DOS command (Windows 2000/XP/2003) that will return total Disk size? Something other than chkdsk, something that will return immediately with the total size (something like dir command).
Add a Comment Sorry, this thread is closed.
About the OP
Los Angeles Joined Dec 2003 Yeah, I Like Me Too
36 Reputation Points
8 Deals Posted
6 Votes Submitted
1,655 Comments Posted

Your comment cannot be blank.

Sign up for a Slickdeals account to remove this ad.

Joined Jul 2004
top secret
> bubble2 3,088 Posts
552 Reputation
Noddy
03-14-2005 at 11:55 AM.
03-14-2005 at 11:55 AM.
How about the old Windows 3.1 / DOS 6.22 MSD utility? I just tried it and it works under XP Pro. You can find it here: ftp://ftp.microsoft.com/Softlib/MSLFILES/ as msdzip.exe
Like
Funny
>
Helpful
Not helpful
Reply
Joined Dec 2003
Yeah, I Like Me Too
> bubble2 1,655 Posts
36 Reputation
Original Poster
hovo73
03-14-2005 at 12:30 PM.
03-14-2005 at 12:30 PM.
Thanks, but the link doesn't work, and does it come standard on Windows 2000/XP/2003 installation? It has to be something that windows already has, i can't install anything. Basically I need to be able to remotely SSH and run that utility and get the results. I can't install or add anything to their Windows installation.

Thanks.

PS. I just did a quick search on Windows Help and there seems to be nothing other than chkdsk and getting it through GUI that does it. I can't believe M$ would be so short sighted and wouldn't include a simple command that would return total disk/partition size.
Like
Funny
>
Helpful
Not helpful
Reply
Last edited by hovo73 March 14, 2005 at 12:33 PM.
Joined Jun 2004
Information Stylist VII
> bubble2 38,558 Posts
2,451 Reputation
XXnarg
03-14-2005 at 12:50 PM.
03-14-2005 at 12:50 PM.
At the command prompt:

c:\>DISKPART (enter)
DISKPART> LIST DISK (enter)

will return the disk size, status, and freespace.

EXIT (enter)

to leave DISKPART and return to the command prompt.

DISKPART [microsoft.com] can use scripts.
Like
Funny
>
Helpful
Not helpful
Reply
Last edited by XXnarg March 14, 2005 at 12:54 PM.
Joined Sep 2003
Error - NULL not valid
> bubble2 1,623 Posts
194 Reputation
yjchung
03-14-2005 at 01:00 PM.
03-14-2005 at 01:00 PM.
Can you use diskpart?

Code:
C:\> diskpart

Microsoft DiskPart version 1.0
Copyright (C) 1999-2001 Microsoft Corporation.
On computer: XXXXXXX

DISKPART> list disk

  Disk ###  Status      Size     Free     Dyn  Gpt
  --------  ----------  -------  -------  ---  ---
  Disk 0    Online        34 GB      0 B

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B
  Volume 1     E                       DVD-ROM         0 B
  Volume 2     C                NTFS   Partition     34 GB  Healthy    System

DISKPART>
EDIT: Guess xnarg beat me to it.
Like
Funny
>
Helpful
Not helpful
Reply
Joined Jul 2004
top secret
> bubble2 3,088 Posts
552 Reputation
Noddy
03-14-2005 at 01:41 PM.
03-14-2005 at 01:41 PM.
Quote from hovo73 :
Thanks, but the link doesn't work, and does it come standard on Windows 2000/XP/2003 installation? It has to be something that windows already has, i can't install anything. Basically I need to be able to remotely SSH and run that utility and get the results. I can't install or add anything to their Windows installation.

Thanks.
The link works just fine, I've just used it but don't waste your time - you never said that it had to be something that was already built-in.
Like
Funny
>
Helpful
Not helpful
Reply
Joined Dec 2003
Yeah, I Like Me Too
> bubble2 1,655 Posts
36 Reputation
Original Poster
hovo73
03-14-2005 at 02:10 PM.
03-14-2005 at 02:10 PM.
Quote from Noddy :
The link works just fine, I've just used it but don't waste your time - you never said that it had to be something that was already built-in.
Nop, it doesn't work, but I see what is the problem, there is an http:// imbeded before ftp:// in the url. But yeah, I can't use it. Thanks.

Xnard and yjchung, thanks for the info. That'l get the info I asked for, but I was hoping to get something that will run from a a generic command prompt. The reason i say that is because it won't be done manually, this will be done programatically and there are some restrictions as to what I can do.

Thanks again.
Like
Funny
>
Helpful
Not helpful
Reply
Joined Jun 2004
Information Stylist VII
> bubble2 38,558 Posts
2,451 Reputation
XXnarg
03-15-2005 at 02:48 AM.
03-15-2005 at 02:48 AM.
Quote from hovo73 :
Nop, it doesn't work, but I see what is the problem, there is an http:// imbeded before ftp:// in the url. But yeah, I can't use it. Thanks.

Xnard and yjchung, thanks for the info. That'l get the info I asked for, but I was hoping to get something that will run from a a generic command prompt. The reason i say that is because it won't be done manually, this will be done programatically and there are some restrictions as to what I can do.

Thanks again.
DISKPART documentation says it can be run with a script from the command prompt.
Like
Funny
>
Helpful
Not helpful
Reply

Sign up for a Slickdeals account to remove this ad.

Joined Mar 2004
L6: Expert
> bubble2 1,468 Posts
177 Reputation
tropical tech
03-15-2005 at 06:35 AM.
03-15-2005 at 06:35 AM.
Quote :
y and there are some restrictions as to what I can do.
And thats a big one !
If the IT dept.has done their job right, you are not going to be able to run disk part!
Is this for a scripting class or you just trying something?
Like
Funny
>
Helpful
Not helpful
Reply
Joined Aug 2004
L7: Teacher
> bubble2 2,375 Posts
940 Reputation
cookiemonster
03-16-2005 at 04:00 PM.
03-16-2005 at 04:00 PM.
Does it have to be exact i.e., the same results as chkdsk, or is a small margin of error acceptable?
Like
Funny
>
Helpful
Not helpful
Reply
Joined Dec 2003
Yeah, I Like Me Too
> bubble2 1,655 Posts
36 Reputation
Original Poster
hovo73
03-16-2005 at 04:38 PM.
03-16-2005 at 04:38 PM.
No it is not a class Smilie it is work:
http://www.integrien.com

It can be off by a little bit.
Like
Funny
>
Helpful
Not helpful
Reply
Joined Aug 2004
L7: Teacher
> bubble2 2,375 Posts
940 Reputation
cookiemonster
03-16-2005 at 11:36 PM.
03-16-2005 at 11:36 PM.
This is gonna take longer than I thought. I'll give you what I've got so far, 'cause I don't think I'm gonna figure it out, like, today.

If you type:
dir c:\ /a /s /-c|find "bytes">abc.txt
you get something like this:
Code:
30 File(s)      335394798 bytes
               0 File(s)              0 bytes
               1 File(s)          89136 bytes
...
               0 File(s)              0 bytes
               0 File(s)              0 bytes
               0 File(s)              0 bytes
               1 File(s)         272824 bytes
           48206 File(s)     9483888693 bytes
            8892 Dir(s)       273432576 bytes free
Now, you need to ignore all but the last 2 lines of the text file, and it's some simple %1 %2 %3 %4 business. Unless I'm missing something, I think you'd have to use the prompt trick that we had to use to ask questions in batch files during the DOS 5 era. You know, before the choice command was developed.

On my laptop, this technique underestimated the total disk space by ~2.7% compared to chkdsk. The results aren't instant, but much faster than chkdsk.
Like
Funny
>
Helpful
Not helpful
Reply
Last edited by cookiemonster March 16, 2005 at 11:41 PM.
Joined Sep 2003
Error - NULL not valid
> bubble2 1,623 Posts
194 Reputation
yjchung
03-16-2005 at 11:52 PM.
03-16-2005 at 11:52 PM.
Are you able to ssh as an administrator user? If so, you can try "fsutil volume diskfree c:"
Like
Funny
>
Helpful
Not helpful
Reply
Joined Aug 2004
L7: Teacher
> bubble2 2,375 Posts
940 Reputation
cookiemonster
03-16-2005 at 11:59 PM.
03-16-2005 at 11:59 PM.
Oh yeah. I forgot to add that diskpart doesn't work on Windows 2000.
Like
Funny
>
Helpful
Not helpful
Reply
Joined Dec 2003
Yeah, I Like Me Too
> bubble2 1,655 Posts
36 Reputation
Original Poster
hovo73
03-17-2005 at 12:46 AM.
03-17-2005 at 12:46 AM.
cookiemonster, that is doable, but it rans for a relatively long time. I can't take too much time to do this. Thanks for the suggestion though.

yjchung, that will work. That is exactly what I need. Regarding admin account, it depends how the user will configure our software, they can enter either administratvie or a regular account in SSH configuration. Chances are they won't enter an admin account. Does it have to be admin?
Like
Funny
>
Helpful
Not helpful
Reply
Page 1 of 2
Sorry, this thread is closed.
 
Link Copied

The link has been copied to the clipboard.