Solved

XCOPY folder sizes

Posted on 2006-06-09
14
598 Views
Last Modified: 2008-02-01
Hi, i want to list folders (and all subfolders) with total size of each folder.

Can i do this with a simple line command in xcopy?

Thanks


0
Comment
Question by:xenium
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 60 total points
ID: 16873976
0
 

Author Comment

by:xenium
ID: 16874028
Thanks. What's the command?
0
 
LVL 10

Assisted Solution

by:GuruGary
GuruGary earned 65 total points
ID: 16874160
For all folders in the current directory you would use:
diruse /* .\

From help:
========================================
Syntax:
DIRUSE displays a list of disk usage for a directory tree(s). Version 1.20

DIRUSE [/S | /V] [/M | /K | /B] [/C] [/,] [/Q:# [/L] [/A] [/D] [/O]] [/*] DIRS

/S      Specifies whether subdirectories are included in the output.
/V      Output progress reports while scanning subdirectories.  Ignored if /S is
 specified.
/M      Displays disk usage in megabytes.
/K      Displays disk usage in kilobytes.
/B      Displays disk usage in bytes (default).
/C      Use Compressed size instead of apparent size.
/,      Use thousand separator when displaying sizes.
/L      Output overflows to logfile .\DIRUSE.LOG.
/*      Uses the top-level directories residing in the specified DIRS
/Q:#    Mark directories that exceed the specified size (#) with a "!".
        (If /M or /K is not specified, then bytes is assumed.)
/A      Specifies that an alert is generated if specified sizes are exceeded.
        (The Alerter service must be running.)
/D      Displays only directories that exceed specified sizes.
/O      Specifies that subdirectories are not checked for specified size
        overflow.
DIRS    Specifies a list of the paths to check.

Note:   Parameters can be typed in any order. And the '-' symbol can be
        used in place of the '/' symbol.

        Also, if /Q is specified, then return code is ONE if any directories are
 found that
        exceed the specified sizes.  Otherwise the return code is ZERO.

Example: diruse /s /m /q:1.5 /l /* c:\users
========================================
0
Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

 
LVL 16

Expert Comment

by:PaulCaswell
ID: 16874197
Hi xenium,

Try:

http://uk.geocities.com/xshareware/download/xdir.zip

command line

xdir /S "/form=*f,*S" /dirs /nofiles

Manual here:

http://uk.geocities.com/xshareware/manuals/xdir_manual.htm

Paul
0
 

Author Comment

by:xenium
ID: 16874278
leew, thanks - was the simple example you gave i needed.
0
 

Author Comment

by:xenium
ID: 16874291
Alternative solution without any tools... produces a not-very-friendly listing but works:

dir *.* /s/a >_size.txt
find /v ":1" _size.txt > size.txt
find /v ":2" size.txt > _size.txt
find /v ":3" _size.txt > size.txt
find /v ":4" size.txt > _size.txt
find /v ":5" _size.txt > size.txt
find /v ":6" size.txt > _size.txt
find /v ":7" _size.txt > size.txt
find /v ":8" size.txt > _size.txt
find /v ":9" _size.txt > size.txt
find /v ":0" size.txt > _size.txt
find /v "----------" _size.txt > size.txt
del _size.txt
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 16874302
Sorry, I didn't get back to the question in time to give the example - that was the help file given by GaryGuru - I'd appreciate it if you'd split the points.
0
 

Author Comment

by:xenium
ID: 16874322
PaulCaswell, thanks for tip - may be useful but i not tested it - diruse working fine.
0
 

Author Comment

by:xenium
ID: 16874329
Oops, i didn't even notice it was someone else was answering!

Ed - pls re-open or split for leew/GuruGary
0
 
LVL 16

Expert Comment

by:PaulCaswell
ID: 16874334
>>may be useful but i not tested it
Try it, you'll like it. You can do a whole lot of things with files and folders. I ought to know, I wrote it! {-)

Paul
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 16874362
Note: Your Dir/find solution won't actually get you accurate information - IF there are folders you don't have access to.  Diruse is not limited by security - it's the only utility I've found that isn't. I haven't checked it, but I THINK PaulCaswell's will have the same security problem.

Security as in NTFS permissions don't permit you access.
0
 
LVL 16

Expert Comment

by:PaulCaswell
ID: 16874395
>>will have the same security problem

It almost certainly does! I'd never thought to test it in that environment. Thanks!

Paul
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 16874414
I consider a good test - find a machine with System Restore (and the System Volume Information folder) and use DIRUSE to check the size.  Then use your util.  Likewise, setup some folders that you don't have access to and see what happens.  Would love to see another util work... but so far...
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question