Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - determine folder size on DISK

Reply
 
Old 4 Weeks Ago   #1 (permalink)
Juergen N.


 
 

determine folder size on DISK

Hello,

I use the following script to determine the size of a specific folder. Which
argument can I use to view the size on disk?

$colItems = (Get-ChildItem C:\Folder -recurse | Measure-Object -property
length -sum)
"{0:N2}" -f ($colItems.sum / 1MB) + " MB"


best regards,

JuergenN



My System SpecsSystem Spec
Old 4 Weeks Ago   #2 (permalink)
Martin Zugec


 
 

Re: determine folder size on DISK

Hi Juergen,

have a look at following thread:
http://stackoverflow.com/questions/5...rom-powershell

Martin
My System SpecsSystem Spec
Old 4 Weeks Ago   #3 (permalink)
Juergen N.


 
 

Re: determine folder size on DISK


"Martin Zugec" <martin.zugec@newsgroup> schrieb im Newsbeitrag
news:ba90d96a-ac08-4449-8c1b-56f10ea529f4@newsgroup
Quote:

> Hi Juergen,
>
> have a look at following thread:
> http://stackoverflow.com/questions/5...rom-powershell
>
> Martin
Hi Martin,

thanks for the link but i don't use compressed files. Do you have an example
script without compressed file info?

best regards,

Juergen


My System SpecsSystem Spec
Old 4 Weeks Ago   #4 (permalink)
Martin Zugec


 
 

Re: determine folder size on DISK

Hi Juergen,

that link is not about compressed files, by rather about
GetPhysicalFileSize function.

This function should give you size on the disk.

Martin
My System SpecsSystem Spec
Old 3 Weeks Ago   #5 (permalink)
Juergen N.


 
 

Re: determine folder size on DISK

Hi,

the following script works (for example with a cluster size of 4kb)

$colItems = (Get-ChildItem c:\folder -recurse | foreach-object -process
{[math]::Ceiling($_.length / 4096)} | Measure-Object -sum)
"{0:N2}" -f ($colItems.sum * 4096 / 1MB) + " MB"



best regards,

Juergen N.


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Using Process Manager to determine what is eating disk space SBS Server
How to determine folder size Vista General
disk size Virtual Server
Folder Size in Size Column Vista file management
Disk size Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46