Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-28
3
Medium Priority
?
5,248 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 1500 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:Stephen 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

721 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