Jump to content

Delete files based on creation date?


Recommended Posts

Guest Hank Arnold (MVP)
Posted

I have a process that backs up some Citrix farm information on a

periodic basis. The files are not large, but the number gets very large,

very fast.

 

Is there a simple command driven way to delete all files that were

created more than x days before? I'd like to run this as a scheduled

task on the server where the files are stored..

--

 

Regards,

Hank Arnold

Microsoft MVP

Windows Server - Directory Services

  • Replies 1
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: Delete files based on creation date?

 

 

"Hank Arnold (MVP)" <rasilon@aol.com> wrote in message

news:OkjNvRSeIHA.3368@TK2MSFTNGP02.phx.gbl...

>I have a process that backs up some Citrix farm information on a periodic

>basis. The files are not large, but the number gets very large, very fast.

>

> Is there a simple command driven way to delete all files that were created

> more than x days before? I'd like to run this as a scheduled task on the

> server where the files are stored..

> --

>

> Regards,

> Hank Arnold

> Microsoft MVP

> Windows Server - Directory Services

 

You could use batch file:

@echo off

set x=30

set source=d:\My Data

xxcopy /rs /db#%x% /ed /yy "%Source%\*.*"

 

You can download xxcopy.exe from a number of sites.


×
×
  • Create New...