Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete files by create date from a known directory

Status
Not open for further replies.

flippe

Programmer
Aug 29, 2002
2
CA
I need to write a windows script to delete files created before a specified date. The directory containing the files is known.
 

you can use the file system object to retrieve the creation datetime of a file then compare it to your base date with the datediff function (If DateDiff(&quot;d&quot;,Filedate,BaseDate)<0 then Kill PathToFile)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top