Computing.Net > Forums > Windows 2000 > Batch program to delete files/folde

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 program to delete files/folde

Reply to Message Icon

Name: Pwest
Date: February 6, 2004 at 14:06:16 Pacific
OS: Windows 2000 Server
CPU/Ram: Pentium II 800 with 500mb
Comment:

Hi
I need a batch program to delete files and folders that are 14 days old on a regular basis. I want this program to be able to use the task scheduler in windows.

Thank you



Sponsored Link
Ads by Google

Response Number 1
Name: pkokkinis
Date: February 6, 2004 at 21:33:57 Pacific
Reply:

There a little program called Obsolete. I've attached the ReadMe from it. I tried finding it again but couldn't. I think it's the best!

OBSOLETE: Clean old junky files. Version 1.00. Jul 05 1992
Copyright (c) 1991 by Yossi Gil, P.O.Box 3148, Jerusalem, ISRAEL.

Usage: obsolete [flags] age [-f] pattern [dir]

Will recursively remove all files which older than 'age' which match 'pattern'.
Recursive scan starts from the current working directory or from 'dir' if
specified. 'age' is a sequence of pairs <N unit> where N is an optional number
and 'unit' is seconds, minutes, hours, days, weeks, moths or years. 'flags' are
one or more flag characters preceded by "- optionally followed by "+" for
turning flag on (default), or "-" for turning it off.

FLAGS -h Print this message and exit
-H+ Remove hidden files too -R- Do not recurse into subdirectories
-S+ Remove system files too -W+ Remove write protected files too
-i+ Ask before removing file -I+ Ask before overriding write protect
-s Silent: don't list files -n Do nothing: just list files

EXAMPLES
obsolete 2 weeks *.tdk c:\ Remove all drive C: 2 weeks old .tdk files
obsolete -R- 2 days *.bak Remove 2 days old .bak files from current dir obsolete day *.* \brief\backup Remove day old files from backup dir
obsolete -n 3 years *.exe \bin List all 3 years old .exe files in \bin
obsolete -s -HSW second *.@@@ \ Silently remove ALL (junk?) .@@@ files


0
Reply to Message Icon

Related Posts

See More


How to block internet con... PGP, Win PT



Post Locked

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


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Batch program to delete files/folde

batch program to stop a service on win_nt www.computing.net/answers/windows-2000/batch-program-to-stop-a-service-on-winnt/9721.html

unable to delete file or folder www.computing.net/answers/windows-2000/unable-to-delete-file-or-folder/51873.html

batch file to delete files that are empt www.computing.net/answers/windows-2000/batch-file-to-delete-files-that-are-empt/33021.html