script to clean up old files

ithawaii
ithawaii used Ask the Experts™
on
I'm looking for a script to delete files that are older than some certain time period like 3 months. The server is win2003 Standard. Plus, the script must be able to run under Scheduled Tasks.

Thanks,
Peter
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Joanne M. OrzechManager, Document Services Center
Top Expert 2004

Commented:
There's a macro found here:
http://www.freevbcode.com/ShowCode.Asp?ID=77
Most Valuable Expert 2011
Top Expert 2011
Commented:
DelDate
http://www.petri.co.il/deldate.htm

Easily scriptable.....

Author

Commented:
excellent! Let me try. I'll let you know.
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Author

Commented:
Let's say I want to remove old files that are more than 90 days old and are located in C:\temp folder.

JOrzech, I tried to run this VBScript under command prompt but keep getting error: ...Microsoft VBScript compilation error: Expected '>'. Here's what I typed: cscript DeleteOldFiles.vbs 90 "c:\temp\*.*"

johnb6767, it doesn't do anything when I typed: DelDate.exe c:\temp 90

Author

Commented:
guys, can you help?
Most Valuable Expert 2011
Top Expert 2011

Commented:
Ill have to check in the am....

Does it bring the help when you type deldate /?

Author

Commented:
yes, it does.
Joanne M. OrzechManager, Document Services Center
Top Expert 2004
Commented:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial