Domanda

Can somebody tell me the best way to delete a series of files between April 1, 2014 and April 17, 2014 on Windows server 2003 command line

È stato utile?

Soluzione

This PowerShell oneliner will do the trick. You can remove the back-ticks and put the code all on one line if you want.

Get-ChildItem C:\data\*.* | `
Where-Object {$_.lastwritetime -gt '4/1/14' -AND $_.lastwritetime -lt '4/17/14'} | `
Remove-Item

I found a shorter version of the script here. I prefer to use the full Powershell cmdlet names though.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top