Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disk usage

185 views
Skip to first unread message

Tapio

unread,
May 9, 2010, 7:50:55 PM5/9/10
to
If I want to know on the command line, what is every disk status (size, used
and free space) there are several method to find answer. Msinfo32 /report
c:\temp\disk.txt /categories +componentsstoragedrives put information on the
file, but that is create other information also.

Here is part of information:

Drive C:
Description Local Fixed Disk
Compressed No
File System NTFS
Size 465,76 GB (500 105 216 000 bytes)
Free Space 442,03 GB (474 621 784 064 bytes)
Volume Name C_Levy
Volume Serial Number B17624CD

I think, for-loop can filter this and after right for-command result look
like this:

Drive C:
Size 465,76 GB (500 105 216 000 bytes)
Free Space 442,03 GB (474 621 784 064 bytes)

There are several other disk also. How get information as above, all disks
with for-loop?

External tools like psinfo with -d parameter bring nice looking information
(with persent of free space), like this:

Volume Type Format Label Size Free
Free
C: Fixed NTFS C_Levy 465.76 GB 442.03 GB
94.9%

But there is also another information and only header and disk information
is what I want to get (like above). For-loop can also help, but what is
right syntax? Without header, I can find information with this command:
psinfo -d | find/i "ntfs". But it's look better with header.

Some utils as fsutil need admin-rights and this is not good, because I run
my system always on limited account rights. Same problem with wmic commands.
Vbs-script not need admin-rights and this might be a good method, but how to
this with vbs-script?

Does anybody knows another method to get disk usage information on the
command line? Nice little freeware programs, perhaps? I try to find
alternate programs, but many of them is only graphical.

It's very good if script or program can tell disk free persent, like psinfo.
This is usually the most significant point on the disk information.

Tapio, again :)


Message has been deleted

foxidrive

unread,
May 9, 2010, 10:08:52 PM5/9/10
to
On Sun, 09 May 2010 19:36:58 -0500, Guy
<Use-Reply-To-Address-Header@[127.1]> wrote:

>Tapio wrote:
>
>> If I want to know on the command line, what is every disk status
>> (size, used and free space) there are several method to find
>> answer. Msinfo32 /report c:\temp\disk.txt /categories
>> +componentsstoragedrives put information on the file, but that is
>> create other information also.
>>
>> Here is part of information:
>>
>> Drive C:
>> Description Local Fixed Disk
>> Compressed No
>> File System NTFS
>> Size 465,76 GB (500 105 216 000 bytes)
>> Free Space 442,03 GB (474 621 784 064 bytes)
>> Volume Name C_Levy
>> Volume Serial Number B17624CD
>>
>> I think, for-loop can filter this and after right for-command
>> result look like this:
>>
>> Drive C:
>> Size 465,76 GB (500 105 216 000 bytes)
>> Free Space 442,03 GB (474 621 784 064 bytes)
>
>

>On one line:
>
>psinfo -d volume>"%tmp%\volnfo.tmp" 2>&1&&findstr ": Volume" "%tmp%\volnfo.tmp"&&del "%tmp%\volnfo.tmp"

That's good Guy but I had to reduce && to & to get any screen output.

For EG:
psinfo -d volume>"volnfo.tmp" 2>&1&findstr ": Volume" "volnfo.tmp"


Here is a method that massages the ouput from msinfo32:
1) A line starting in column one has wrapped
2) The type command is used to convert the unicode file to ansi format.

@echo off
"c:\Program Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe"
/report disk.txt /categories +componentsstoragedrives
type disk.txt > disk.tmp
findstr "Drive Description Size Free" disk.tmp
del disk.txt disk.tmp
pause

--
Regards,
Mic

Tapio

unread,
May 10, 2010, 6:24:58 AM5/10/10
to

"foxidrive" <got...@woohoo.invalid> wrote in message
news:p9qeu5122rqgikein...@4ax.com...

Both examples work well.
Guy found another parameter "volume", what's cut most of needles
information, what psinfo -d create.
Another thing, what I'm not notice this before, that findstr can find
multiple search string in one time. That's good to know.

Thank you Guy and Mic.

Regards,
Tapio

Ted Davis

unread,
May 10, 2010, 9:28:20 AM5/10/10
to
On Mon, 10 May 2010 02:50:55 +0300, Tapio wrote:

> Does anybody knows another method to get disk usage information on the
> command line? Nice little freeware programs, perhaps? I try to find
> alternate programs, but many of them is only graphical.
>
> It's very good if script or program can tell disk free persent, like
> psinfo. This is usually the most significant point on the disk
> information.

Is there some reason you can't use PsInfo?

psinfo -d Volume

returns the disk data only, along with a bit of header information.

(psinfo -d Volume | find "%") 2> nul

displays only the actual information without the headers and splash.


--
T.E.D. (tda...@mst.edu)

Tapio

unread,
May 10, 2010, 9:39:48 AM5/10/10
to
"Ted Davis" <tda...@mst.edu> wrote in message
news:pan.2010.05.10....@mst.edu...

Thank you, it's work great.

> Is there some reason you can't use PsInfo?

Actually no important reason. Psinfo do the job fine. I just ask on
curiosity reason, are somewhere similar programs. Sometimes I try more than
one program, what makes same thing. After I try them all, usually one of
them fascinate more than others. Reason can be fastness, look of result
etc..

Regards,
Tapio

alexsupra

unread,
May 12, 2010, 5:35:07 AM5/12/10
to

there is one useful command line tool which i use myself for getting
disk drive summary.
thats free software by Jason Hood called jNDIR http://adoxa.110mb.com/jndir/index.html
example of usage: jndir -i -k

Tapio

unread,
May 12, 2010, 11:37:09 AM5/12/10
to

"alexsupra" <alex...@gmail.com> wrote in message
news:3e149250-f8a0-45e1...@e35g2000yqm.googlegroups.com...

That's nice and very fast utility. Much faster than psinfo. Here is sample
output:

file sys total space free space [Cluster Size] UNC path
======== =============== =============== =======================
C: NTFS 500,105,216,000 474,364,047,360 [ 4096] C_Levy
===============================================================================
500,105,216,000 474,364,047,360 Total
Physical space


It's a pity, utility not calculate percent of disk free size.

Tapio


0 new messages