?
Solved

XCOPY folder sizes

Posted on 2006-06-09
14
Medium Priority
?
607 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 240 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 260 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

719 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