Solved

How to delete files based on their age in day

Posted on 2008-09-29
2
197 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
2 Comments
 

Author Comment

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

Accepted Solution

by:
Shift-3 earned 250 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Xcopy / Robocopy Question 7 65
Removing first 4 characters from date field in csv file 7 37
how to split multiple lines delimiter : 8 99
xcopy loop 13 54
If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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