?
Solved

How to delete files based on their age in day

Posted on 2008-09-29
2
Medium Priority
?
205 Views
Last Modified: 2012-06-27
How can I use a batch file to delete files based on creation date in days
0
Comment
Question by:Vincent Costanza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:Vincent Costanza
ID: 22602050
Thanks for you help
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 1000 total points
ID: 22605455
You can do this with a vbscript like the one from this article:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov06/hey1117.mspx

Doing it in batch is difficult, as math with dates is problematic.  There is the Forfiles utility, but it only works on modified date, not creation date.
http://technet.microsoft.com/en-us/library/cc753551.aspx
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question