Solved

XCOPY folder sizes

Posted on 2006-06-09
14
578 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now