-**** Posted from RemarQ, http://www.remarq.com/?b ****-
Real Discussions for Real People
Yes. Here's the output of the du (disk usage) command included with
my Hamilton C shell:
30 C% du
c: 2096.160 M Total = 1622.368 M Used + 473.792 M (22.60%) Free win95
d: 1534.176 M Total = 642.642 M Used + 891.534 M (58.11%) Free winnt
e: 2047.968 M Total = 339.456 M Used + 1708.512 M (83.42%) Free
f: 6835.624 M Total = 3314.908 M Used + 3520.716 M (51.51%) Free
g: could not be accessed.
h: 617.308 M Total = 617.308 M Used + 0.000 M (00.00%) Free neast497
r: 324.545 M Total = 320.705 M Used + 3.840 M (01.18%) Free winnt
t: 860.560 M Total = 826.416 M Used + 34.144 M (03.97%) Free win95
I have it configured for my own use to list everything other than a: that's
accessible. In this example, the "30 C%" is the C shell prompt, "du" is
what I typed, the rest is output from the du utility. G: is removable drive
(actually a digital camera memory card reader) with nothing in it, c:
through f: are local hard disk drives, h: is a cdrom, r: and t: are on another
machine over my network.
As before, this is all part of the demo version you'll find on my website
(see http://www.hamiltonlabs.com/cshell.htm) though I do need to add
one caveat: If you are using FAT32, I'll need to give you the new build
of du, not yet up on my site. Just ask. (When MS introduced FAT32,
they also introduced a new Win32 api specifically to support it.)
--
Regards,
Nicki Hamilton
Nicole Ashley Hamilton KD1UJ hami...@hamiltonlabs.com
http://www.hamiltonlabs.com Phone 781-487-0008 FAX 781-487-0009
Hamilton Laboratories, 45 Kings Way, Unit 14, Waltham, MA 02451-9039, USA
Not in percentages. I do have one that returns one of the following.
min bytes free: 100,000,000
min bytes free: 10,000,000
min bytes free: 1,000,000
min bytes free: 100,000
min bytes free: 10,000
min bytes free: 1,000
min bytes free: 100
min bytes free: 10
min bytes free: 1
Regards,
Outsider
Sorry, I addressed the wrong question in my previous answer.
This will give you the number of files and disk space used,
but *not* in percentage. This returns the info for the
current directory, so if you want info for the entire drive,
you must be in the root.
Ansi.sys required; # represents the escape character,
created in edit by 'Ctrl+P Esc'.
:: howmany.bat
FOR %%v IN (D d) DO IF "%1"=="%%v" GOTO DETAILS
DIR/A-D/W/S |FIND "file(s)"|SORT/R |FIND/N "file(s)"|FIND "[1]"
IF not errorlevel=1 ECHO #[1ATotal:
GOTO end
:details
DIR/A-D/S/W|FIND "i"|FIND/V "Volume"|MORE
ECHO.
:end
HTH,
Outsider
If you're on win98, you already have it (and should get the security fix for
it, since a web page can use it to wipe you out.).
set loc=%temp%
set dircold=%dircmd%
set dircmd=
cls
ECHO The number and size of files in and below this folder, %1, is:
DIR %1 /-B/S/V/A | FIND "bytes" /i > %loc%\files.tmp
FIND "file(s)" %loc%\files.tmp | SORT /R | FIND "bytes" /N | FIND
"[2]"
ECHO.
ECHO %1 Directory uses
FIND "dir(s)" %loc%\files.tmp /i | SORT /R | FIND "bytes" /N/i | FIND
"[2]"
DEL %loc%\files.tmp
SET DIRCMD=%DIRcOLD%
pause
:end
for %%a in (dircold loc) do set %%a=
-----------------------------------------------------------------