Files last modified and total size script

Reading Time: < 1 minute

The below script will search for all files and folders modified after a certain date and then provide you with a total size in MB.

Amend the date and disk letter within the script as required, or add the path to the folder you wish to run the script against.

To be able to run the below script download Powershell and make sure you have a minimum of .net 2 installed. Powershell can be downloaded for free.

Write-Host $size
$length = (gci ‘C:\’ -Recurse |?{$_.lastwritetime -gt ’03/06/2009′}| Measure-Object length -Sum).sum

$size = ($length/1MB)

Write-Host $size

Please follow and like us:

4 thoughts on “Files last modified and total size script

  1. Great bit of code there.
    Does take up a large amount of CPU but i ran it out of business hours. It’s great. Thanks admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.