Solved

XCOPY folder sizes

Posted on 2006-06-09
14
583 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
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 95

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 95

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 95

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 95

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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