Computing.Net > Forums > Programming > Get a Folder size in a batch file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Get a Folder size in a batch file

Reply to Message Icon

Name: jconner
Date: February 18, 2004 at 18:18:16 Pacific
OS: win 2k RH9
CPU/Ram: 2.6 1 gig ram
Comment:

I am trying to get a folder size in a batch file but can't figure it out.
is there a way???
thanks,



Sponsored Link
Ads by Google

Response Number 1
Name: Code One
Date: February 18, 2004 at 18:34:59 Pacific
Reply:

dir [path]
pause


0

Response Number 2
Name: jconner
Date: February 18, 2004 at 21:59:24 Pacific
Reply:

I need the size of folders in kb,mb gb...
or just b...
dir doesn't list the size of folders, only files.
for example: on linux I can type
du -h --max-depth=1 /home/js/dir.txt
and that gives me the size of only directories.
I am trying to write a windows batch file to sort folders into groups of <700mb for backing up to cd


0

Response Number 3
Name: drigz
Date: February 19, 2004 at 04:48:30 Pacific
Reply:

why batch? if say your are in c, and you want to kno the size of windows, you could run dir c:\windows, although it would not account for folders inside windows.



0

Response Number 4
Name: jconner
Date: February 19, 2004 at 14:13:44 Pacific
Reply:

I have a little over 200 gigs of data That I need to back up to CD or DVD depending on size.
Some folders are under 1 meg, and some are over 3gigs. For simplicity, I need to keep from breaking up folders on to multiple CDs. In addition, I need to keep the original location and naming just incase I need to load them back to the server. All of these folders contain linked items so if they are renamed or not in the same directory I would not be able to use them.
I am able to do this easily with Red Hat Linux. But, I would like our staff to be able to do it and they are not familar with linux.
Here is the format I get from Linux:
5m folder1
1.g folder2
I would like to get something similar in windows with either C++, or a batch.

Thanks Again for any help!!!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Programming Languages debug and release diff. i...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Get a Folder size in a batch file

Robocopy function in a batch file www.computing.net/answers/programming/robocopy-function-in-a-batch-file/13172.html

Text Input Box in a Batch File www.computing.net/answers/programming/text-input-box-in-a-batch-file/15016.html

need a batch file www.computing.net/answers/programming/need-a-batch-file/13744.html