Solved

Batch script - Delete files older than X days with multiple targte folders

Posted on 2007-03-28
3
5,242 Views
Last Modified: 2008-01-09
Hi,

I am looking for a batch file to delete files older than X days

I found one here: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_21887658.html

By SteveGTR which looks perfect but since I have to look in like 30 different folders I don’t want 30 separate batch files, Is it possible to modify this to so you set multiple source directories?
0
Comment
Question by:arundelr
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 500 total points
ID: 18810268
The batch processing in that solution accepts an optional directory as a parameter. You could call it from another batch file like this:

call DelOldFiles.bat "c:\temp"
call DelOldFiles.bat "c:\tmp"

Good Luck,
Steve
0
 
LVL 4

Expert Comment

by:mctigue
ID: 18812493
i have a way to do it in vbscript with one folder and i'm sure if you know vbscript or vb you could easily make it go through as many folders as you want.
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 19166949
Whatever...
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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