Computing.Net > Forums > Windows XP > batch files

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.

batch files

Reply to Message Icon

Name: Charles Gentry
Date: June 29, 2009 at 08:32:05 Pacific
OS: Windows XP
CPU/Ram: 1 gig
Subcategory: General
Comment:

How do I delete folders by age using a batch file?



Sponsored Link
Ads by Google

Response Number 1
Name: SocialAbortion
Date: June 29, 2009 at 09:40:08 Pacific
Reply:

The xcopy command has an option for copying files
modified on or after a specified date. Is that what you're wanting
to do?


0

Response Number 2
Name: Charles Gentry
Date: June 29, 2009 at 15:05:06 Pacific
Reply:

Well, I really want to delete folders not modified in the last 3 months, and I can't figure how to use xcopy to do that.


0

Response Number 3
Name: Charles Gentry
Date: June 29, 2009 at 15:07:05 Pacific
Reply:

More precisely, I want to delete folders, and their subfolders, that simply show a folder date at least 3 months old or older.


0

Response Number 4
Name: dtech10
Date: July 2, 2009 at 16:02:41 Pacific
Reply:

Hi Charles

Post a dir listing and the output of the command Echo %Date%.



0

Response Number 5
Name: Charles Gentry
Date: July 2, 2009 at 16:11:43 Pacific
Reply:

Thanks - will try it!


0

Related Posts

See More



Response Number 6
Name: Ewen
Date: July 2, 2009 at 16:24:29 Pacific
Reply:

... and remember this type of post belongs in "Programming", see the link on the right.

http://ewen.uuuq.com/


0

Response Number 7
Name: ghostdog
Date: July 4, 2009 at 18:43:41 Pacific
Reply:

>> How do I delete folders by age using a batch file?

download findutils (see my sig) and use the GNU find command

c:\test> find c:/ -type f -mtime + 90 -delete

that's all you need. the above says delete all files more than 3 months old.

GNU win32 packages | Gawk


0

Response Number 8
Name: Charles Gentry
Date: July 6, 2009 at 16:24:11 Pacific
Reply:

Thanks!


0

Response Number 9
Name: wanderer
Date: July 6, 2009 at 16:28:42 Pacific
Reply:

uh.. windows folders will be more than three months old. Be careful as to where you target your batch file.


0

Response Number 10
Name: Charles Gentry
Date: July 6, 2009 at 17:25:00 Pacific
Reply:

Yes, only certain folders.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: batch files

Auto folder Batch file www.computing.net/answers/windows-xp/auto-folder-batch-file/145055.html

simple batch file www.computing.net/answers/windows-xp/simple-batch-file/149160.html

Change hostname from batch file? www.computing.net/answers/windows-xp/change-hostname-from-batch-file/159541.html