Easy way to gather file sizes of unc paths

pathunc

Is there a program or a script I can run against a csv containing thousands of UNC paths? Something not very intrusive – simply looking to gather file sizes of each.

Thanks.

Best Answer

You should be able to mash together a bunch of components of PowerShell fairly simply to do what you want.

However, due to the nature of gathering sizes of a folder containing many files, it will be relatively intrusive - i.e. IO-intensive and will take a while to run. This is a consequence of how filesystems work (the size of a folder is not stored anywhere, it must be computed by traversing the folder recording the sizes of files as it goes.

There's an article in the TechNet Library about determining the size of a (single) folder which would probably be useful to you.

PowerShell also has cmdlets called Import-Csv and Export-Csv which will be useful for dealing with CSV data.

Related Topic