Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
How to get files older than 15 days
Name: yeshwanth Date: August 3, 2009 at 04:43:48 Pacific OS: Windows Server 2003 Subcategory: Batch
Comment:
Hi All,
I am writing a batch script to zip the files which are older than 15 days. I can loop through the files inside a folderm but I am not sure how to get the date propertie of the file and check with the current date
Name: Valerie (by Garibaldi) Date: August 4, 2009 at 02:15:06 Pacific
Reply:
What is your date format?
Do you have permissions to download/install a utility?
0
Response Number 2
Name: yeshwanth Date: August 4, 2009 at 02:19:18 Pacific
Reply:
No, I do not have permission to download a utility. The date format is 8/5/2009 10:38 AM.
Also, if I am using powershell script can this be more easy ?
Thanks Yeshwanth
0
Response Number 3
Name: dtech10 Date: August 4, 2009 at 15:18:30 Pacific
Reply:
Hi yeshwanth
I dont know anything about poershell,but it can be done in normal batch script. It's a little more complex to do it dedends on your dir listing and date format
Type the commands below and post their output here. It do'es not need to be a fulldir listing and state wether your date format is mm/dd/yyyy or another format.
Summary: Hi People, Please help me with the DOS code to delete files older than 15 days. i will schedule the batch file then. We are doing this to delete older backup files and preserve latest files only to sa...
Summary: Greetings All! The following MS-DOS code will delete any specified files, in specified location, and older then a specified date. "Delete files by older-then-date". Quick pseudo example: Delete *.t...