Solved

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

Posted on 2007-03-28
3
5,237 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

896 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now