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