Computing.Net > Forums > Programming > How to get files older than 15 days

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

Reply to Message Icon

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

Thanks,
Yeshwanth



Sponsored Link
Ads by Google

Response Number 1
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.

dir
echo %Date%


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to get files older than 15 days

HELP Del Files Older Than 15 Days? www.computing.net/answers/programming/help-del-files-older-than-15-days/14957.html

Batch File to Delete Files Older Than 1 Day www.computing.net/answers/programming/batch-file-to-delete-files-older-than-1-day/18765.html

Delete Files Older Then x-Days www.computing.net/answers/programming/delete-files-older-then-xdays/15229.html