Batchfile: Delete Files every X Days

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Wajaja

Thread Starter
Joined
Oct 26, 2007
Messages
4
Hello!

I'd like to make a Batchfile that deletes Files in a specific Folder that are older then "30"days. Now what it should do first is Delete all Files in all Subdirectorys which are older then "30" Days... and then if the Subdirectorys are older then "30"Days delete the Subdirectorys if they're empty.

Help!
 

Wajaja

Thread Starter
Joined
Oct 26, 2007
Messages
4
So those examples you gave me reffer to Visual Basic? Isn't it possible to do with a batchfile?
 
Joined
Apr 7, 2007
Messages
4,910
why do you want a Batch if there are other sources

this little prog does the same
http://www.jpsdomain.org/public/tools/obslt10.zip

============================================================
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 *[email protected]@@ \ Silently remove ALL (junk?) [email protected]@@ files
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top