Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to Display Folder size ?

Posted on 2003-03-11
6
Medium Priority
?
716 Views
Last Modified: 2007-12-19
IS there any way to see the size of folder in either CMD> and Windows Explorer without the contents/files ?

Please Advise
0
Comment
Question by:joehuang
6 Comments
 
LVL 8

Expert Comment

by:netmage
ID: 8114728
In windows explorer, Right click "folder", select "properties".

Is this what you require?
0
 
LVL 4

Expert Comment

by:daletian
ID: 8114765
Not from the command prompt - no

As far as I'm aware, u can only list folder size from windows explorer by checking the folder properties.
0
 
LVL 22

Expert Comment

by:cookre
ID: 8115561
Put this in a cmd file.
Pass it the name of the directory you're interested in.


@echo off
dir /s %1 | find "File(s)" >a.a
for /F "tokens=1-4 delims= " %%a in (a.a) do (
set XXX=Files:%%a Total Size:%%c
)
del a.a
echo %1 : %XXX%

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 7

Expert Comment

by:billious
ID: 8116526
Cookre,

that even works!

well, nearly works.

if you were to use a dir /s/a-d then the filecount would be better. Unfortunately, it'll still be off by 1 because the file 'a.a' will be included in the count, but it's not there before or after.



...Bill
0
 
LVL 7

Expert Comment

by:billious
ID: 8116542
...though, of course the filecount SHOULD be accurate if your logged directory is not included in the tree on which you are reporting.

...Bill
0
 
LVL 22

Accepted Solution

by:
cookre earned 60 total points
ID: 8117100
Well, in that case, one could always test for the same directory with a bit of effort and some extra CMD files given that the NT DOS extensions include:


/a on SET for evaluating expressions:
set /a filcnt=%%a - 1


and the ability to extract a parameter's drive letter with %~dx and path with %~fx, where x is the parameter number.
(left as an exercise for the over-eager lurker)

0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Ready to kick start your career in 2018? Add app developer skills to your resume. January’s Course of the Month features Android App Development training with hands-on learning.  Read on to learn why these skills are important.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

571 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