Archive for June, 2009

Powershell Script to delete files older than 2 days

$DataFolder = “c:\scandocs”
$2Days = (get-Date).adddays(-2)
Get-Childitem $DataFolder -recurse | ?{!$_.PSIsContainer -and ($_.LastWriteTime -lt (get-Date).adddays(-2))} | remove-item -whatif -force


About

You are currently browsing the weblog archives for the month June, 2009.

Longer entries are truncated. Click the headline of an entry to read it in its entirety.

Categories