Function to determine Directory Size

I'd like to be able to determine the size of a directory or group of files.
Does anyone know of an add-in that has a function whereby I can specify a
path and get the size of directory of groups of files as the return value?
Ex:
=dirsize("C:\Documents and Settings\Bob\My Documents\School")
=dirsize("C:\Documents and Settings\Bob\My Documents\School\*.doc")

It would also be helpful if there were an option to include subdirectories.

--
Thanks,
Bob Chmara


0
bob6827 (2)
9/27/2004 12:51:09 AM
excel 39879 articles. 2 followers. Follow

2 Replies
537 Views

Similar Articles

[PageSpeed] 34

Argh....

Make that "get the size of a directory or group of files"

Bob

"Bob Chmara" fatfingered...
| specify a path and get the size of directory of groups of files as the
return value?


0
bob6827 (2)
9/27/2004 1:14:06 AM
I think this will do a folder, but I'm not sure of a way to do wildcard on 
individual files.  Hopefully someone can add to this.

Function DirSize(s As String) As Double
    Dim fso
    Set fso = CreateObject("Scripting.FileSystemObject")
    DirSize = fso.GetFolder(s).Size
End Function

?DirSize("C:\Documents and Settings\Bob\My Documents\School")

HTH
Dana DeLouis


"Bob Chmara" <bob@chmara.spamfree.com> wrote in message 
news:D-qdndsYUdud-crcRVn-og@comcast.com...
> I'd like to be able to determine the size of a directory or group of 
> files.
> Does anyone know of an add-in that has a function whereby I can specify a
> path and get the size of directory of groups of files as the return value?
> Ex:
> =dirsize("C:\Documents and Settings\Bob\My Documents\School")
> =dirsize("C:\Documents and Settings\Bob\My Documents\School\*.doc")
>
> It would also be helpful if there were an option to include 
> subdirectories.
>
> --
> Thanks,
> Bob Chmara
>
> 


0
delouis (422)
9/27/2004 3:51:51 AM
Reply:

Similar Artilces:

I am looking for a function for linear interpolation
I am looking for a function for linear interpolation Look in HELP for the LINEST() function -- Kind regards, Niek Otten Microsoft MVP - Excel "azad" <azad@discussions.microsoft.com> wrote in message news:C53A752C-DF76-4B9F-9145-6F39495088B7@microsoft.com... >I am looking for a function for linear interpolation ...

CFileDialog selecting directorys only
I Have a CFileDialog and I just want to be able to select directorys no files. Can this be done? use SHBrowseForFolder http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shbrowseforfolder.asp HTH, "Chris Baker" <ChrisBaker@discussions.microsoft.com> wrote in message news:5185346E-6097-4B9C-89B1-D6588C87249A@microsoft.com... >I Have a CFileDialog and I just want to be able to select directorys no >files. > > Can this be done? > You also might take a look at www.codeproject.com/dialog/cfolderdialo...

Adding if to Average If Array function
Hi, I recently had help understanding the following formula {=IF(ISERROR(AVERAGE(IF(Score>0,Score))),"",AVERAGE(IF(Score>0,Score)))} Thanks to Luke M, Pete UK and David Biddulph who provided the explanation. I've now been asked to add to this formula so that if either Q3 or Q4 is greater than 4 then the average cannot be lower than 3. Q1:Q35 is the named range score. This is really complicated because I still need to have an average and I'm thinking that the If part is non array but the average part still needs to be an array. Can you mix and match ...

Can I use the NOW() function in a formula?
I have a cell B1 that has NOW() time and another cell B2 that has NOW() date. I am trying to have data from another cell F1 brought in to the destination cell B3, when a given date and time occur. =(IF(AND(B1="23:00:00",B2="12/03/2009"),F1," ") This formulas does not work. The Clock is continuously active / always changing. Any suggestions would be appreciated. Thanks. The NOW() function returns both a date and a time. Even if you format the cell to display only date/time, all the data is still retained. NOte that if you did want just the d...

Conditional format to determine if last character in a cell is a number or a letter
I have a spreadsheet where I enter weights. The weights can be any whole number 1-99999. I would like to be able to flag suspicious weights using conditional formatting by putting a letter as the last character, such as 123a, or 57b, 4471c, etc.What conditional formatting formula can I use to accomplish this? Thanks, Tonso Assuming your weights are in column A, starting with A2, highlight the cells in that column with A2 as the active cell, and use this formula in the CF dialogue box: =3DAND(CODE(UPPER(RIGHT(A2)))>=3D65,CODE(UPPER(RIGHT(A2)))<=3D90) Then click on the Format button a...

Sum function
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I am trying to put together a spreadsheet for a business plan and am having problems with the autsum and autofill functions. Firstly, even though I do a simple autosum, if I change a value in a cell, the sum does not change. Secondly, if I try to autofill across columns, the values of those columns simply mirror the value of the first. In other words it copies it. I am at a loss how to get round it as I have been working w Excel for years and have never had this problem. I have experimented with a new worksheet with ...

exchange will not start, error directory service cannot start
after a power outage, my server would not boot. Found that three of the hard drives were offline, (raid 5 with five disks) Called dell, brought two back online and did a rebuild on the last one that was offline. They are all online but when I boot it up I get this error: Security accounts manager initialization failed because of the following error: Directory Service cannot start. Error status: 0xc00002e1. Please shutdown and reboot into Directory Services Restore Mode. I have been on hold with MS tech ....... -- Glenn MCP A+ Network Admin MBBC ...

Need help with correct function or input for this problem/scenario
I have a situation where I am creating a borrowing base for a company. (I am going to shorten numbers to make it easier.) There is a $300 loan. Type A loan can borrow up to $300. Type B loan can borrow up to $150. Type C loan can borrow up to $50. I need a formula to input in excel that will give me a borrowing base for type B and C loans. For example, to borrow in type B loans, I have to check 1-what's outstanding on the entire loan. 2-what's outstanding on type B loans. 3-Take those two numbers and figure out what can be advanced under the answer to those questions. (I.E. $2...

Change paper size
I am using an Epson R300 printer and I can't seem to be able to alter the paper size in the print properties box, it only has A4 available. I can change the size in page setup, but this does not change the size the printer wants to print on. This only seems to be happen Publisher, if I try it in Adobe Photoshop for instance I have many paper sizes available. Did you try in File, Print Setup? -- Don Vancouver, USA "Hecate" <Hecate@noemail.co.uk> wrote in message news:3rfih.19331$k74.16420@text.news.blueyonder.co.uk... >I am using an Epson R300 printer and I c...

sum function usin an IF statement
Bit short on detail, but maybe =IF(rng>10,rng) as an array formula, committed with Ctrl-Shift-Enter or =IF(rng1>some_val,rng2) again an array formula, where rng1 and rng2 are the same size. -- HTH RP (remove nothere from the email address if mailing direct) "jimk" <jimk@discussions.microsoft.com> wrote in message news:2873BFCF-598E-4956-808C-31C1638741A9@microsoft.com... > ...

Using Filter string with IF function
Is there a way to use a filter string with the IF function? I have a spreadsheet that looks like this: Invoice No. Invoice Date Invoice Currency Invoice Value 1 dd/mm/yyyy USD 1234.56 65 dd/mm/yyyy USD 2345.67 74 dd/mm/yyyy EUR 3456.78 88 dd/mm/yyyy USD 4567.89 when I filter on the currency: is there a function such as if(filter_string="USD";TRUE;FALSE)??? Thanks Aref Maybe this: Assuming row 1 are t...

Mail Box Size
Exchange 2000 SP3 + rollup. Is there a limit to the size any one user's mailbox?. I have a client with one user having a 6 Gig mail box. Yes, that is correct 6 GIG for one user. Thanks B the only limit is the limit of your store, ie if standard then 16GB(if hes the only user) enterprise = as much disk space as you have Bob wrote: > Exchange 2000 SP3 + rollup. Is there a limit to the size any one user's > mailbox?. I have a client with one user having a 6 Gig mail box. Yes, that > is correct 6 GIG for one user. > > Thanks B > > On Wed, 13 Jul 2005 ...

exchange 2000 size limitation and exchange server im
Hi All: Did Microsoft release an update to increase the maximum database size in Exchange 2000 Standard Edition to 75 GB as they did with Exchange 2003, Service Pack 2? I would guess not. Also, Exchange Server 2000 had an IM feature that worked with the Windows Messenger program. It looks like this functionality was removed for Exchange 2003, is that correct? Drew Drew <drew@drew.com> wrote: >Did Microsoft release an update to increase the maximum database size >in Exchange 2000 Standard Edition to 75 GB as they did with Exchange >2003, Service Pack 2? I would guess n...

Sum Function (was summing 13 cells to the left)
Trying to compose a formula that will only sum 13 cells to the left (13 months of data). When columns are added, I still only want to sum thirteens months of data. Can this be done without constanty changing my formulas? Make sense TIA Neil S. Hi see my reply to your old post -- Regards Frank Kabel Frankfurt, Germany Neil S. wrote: > Trying to compose a formula that will only sum 13 cells to the left > (13 months of data). When columns are added, I still only want to > sum thirteens months of data. Can this be done without constanty > changing my formulas? Make sense? ...

Another Issue With A Function
Ron Rothstein suggested and I used this function in my Excel 2003 Workbook: Public Function QBRushYds(W, Q) QBRushYds = Worksheets("Week" & W).Range("C2").Offset(Q).Value / 10 End Function In Worksheet Totals Cell B56 thru B59 I have the following four calculations: =TRUNC(QBRushYds(1,1)) =TRUNC(QBRushYds(1,2)) =TRUNC(QBRushYds(1,3)) =TRUNC(QBRushYds(1,4)) In Worksheet Week1 Cells C3 thru C6 I have the following values: 725 814 283 9 The function correctly calculates the values: 72 81 28 0 If I change any of the values in C3 th...

And function into If function
I´m trying to get this function to work. But I´m getting an error message. =If(and(100/I6)*I7>101); I7<I6; 1; 0) What the function is supposed to do is to detect peak values in chart table that are measure errors from a measuring intrument and count every peak as 1. This is how the function is ment to operate: If the percent of the difference of the rise from the former cell to the next cell in the sequence of data is larger than 101% AND the value of this cell is smaller than the former cell then true=1 False=0 Im using a norwegian version of excel and I´m no...

Macro open a file in any drive/directory
Hello, I'm tryign to do a macro that will open a file. I want it to bring up the Open File dialog, so that users can search the file they want. Example, the file might be in any drive and one user might call the file differently, so need to be able for users to open the file. I know there'' GetFile code, but can't figure right coding. please advise any help. thank you, juan To show the file>open window use Application.Dialogs(xlDialogOpen).Show -- Regards, Peo Sjoblom "Juan" <jhernan562@aol.com> wrote in message news:00c601c3dc5e$45ef40d0$a401...

Limiting size of worksheet
I want to set up a worksheet and limit to 25 columns and 200 rows. I seem to can't find it. Any suggestions are appreciated. Jo -- JB ----------------------------------------------------------------------- JBL's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1504 View this thread: http://www.excelforum.com/showthread.php?threadid=26668 Joe You cannot do away with the unused cells. A worksheet has 256 columns and 65536 rows. You can hide the rows and columns you don't want to see. Select them and Format>Hide. Alternative.........You may want to...

Directory Ghost
Hello Everyone, I have a problem that I just can not understand or fix. I work in a VERY large exchnage envirement. They are running windows 2000 with exchange 5.5 on 271 Sites. Each site contains 1 to 15 servers. Heres the History: 1. We have a user that was on Server2 in Site B. 2. Her new mailbox was Created on Site A Server1 3. Her old Mailbox was deleted from Server2 Site B. 4. Server2 on Site B was moved to Site A ( I do not know the order this was done in..Neither does anyone else) Heres The Problem: Th user now recieves an NDR report whenever someone sends her an email...

How do I set the size of a chart in excel (without using the mous.
How do I set the size of a chart in excel (without using the mouse)? You can set the size programmatically: With ActiveSheet.ChartObjects(1) .Width = 300 .Height = 200 End With katy wrote: > How do I set the size of a chart in excel (without using the mouse)? -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html Hi, If you hold the shift key whilst selecting the chart you can move with the cursor keys. CTRL+1 will display the format dialog which will allow you to alter the height and width. Only thing is I don't know how to select t...

Working window in Access "sticks" to Maximum size
Hello, I'm trying to figure out how to 'unstick' a working form/report/table, etc in Access. Even if I design an entry form at say, 3" by 5" wide, it'll automatically maximize to fill up the entire working screen next to the navigation bar. To my knowledge, I have never set any property to maximize every window. . . Did I miss a global setting, or is it an option I can turn off? Thanks, Tripler "Tripler of the SDMB" <Tripler of the SDMB@discussions.microsoft.com> wrote in message news:96E65DF9-A187-4710-A6AC-2350A66F38D1@microso...

Rank Function? #2
Why would my RANK function be returning #DIV/0! ???? Didn't know this was possible. Anybody run into this before? Thanks!! > Didn't know this was possible It isn't - so Excel is saying that you are trying to do the impossible :) Your code will probably need to check for and exclude zero values -- Message posted from http://www.ExcelForum.com ...

Hlookup function
I am currently creating a page that has a column of calculations in it. The calculations are amounts of Future options. at the bottom of the column I calculate an average 6 month total by simply suming 6 months into the future. The question I have is how do I automate the Total sum number at the bottom, because every time I update my worksheet I have to redo all my calculations because the previous months value is now 0 because there is no future value anymore, so I have to rename my range and do my calculation over again. I originally thought of the Hlookup function but I can't get it to ...

Rounding for order size
I'm doing a forecast using some formulas. I want the result to take in consideration the minimun order size. For example if my forecast is 38 I want the result to be expressed as 48 which is the minimun package size. The same for example if forecast is 500 I want it to show 480 or 528 which are the actual amounts that I can request. How can I do this? FA Hi! So, what you want to do is round to the nearest multiple of 48? =ROUND(A1/48,0)*48 Biff "FA" <FA@discussions.microsoft.com> wrote in message news:F6E4BD59-5B85-487E-98B7-96E568FB1E44@microsoft.com......

CDateTimeCtrl ideal size #2
Hi, does anyone know a trick how to get the ideal size for the CDateTimeCtrl to display all of its content in all formats it supports? It doesn't resize itself to a proper size for its content and it seems it has alot of internal logic for sizing the various internal edit fields. A simple GetWindowText() and GetOutputTextExent() doesn't work in all cases (i.e. when there are date/time formats set without leading zeros). I know there is a special window message available on vista to fetch the ideal size of the CDateTimeCtrl, but what to do in previous windows versions ? Many t...