jbseventeen wrote:Hmm...not quite since it even renames files <7 days old.
As I understood the task, the files going into the target folder manually aren't going to be there for long before this script runs.
This will put a 30 day expiry on them and in 30 days they won't exist.
#### 1. moved line "md "%target%" 2>nul" further down to prevent %target% from being created when there are no files to process ####
Again, the task mentioned that there were always going to be files in this folder.
If it's going to be empty for a couple of days then there is no damage from having an empty folder on the desktop.
) #### 2. removed parameter "/xd "%target%" " to allow processing of files in %target%\ ####
This breaks the code, as you have outlined the rules.
if filename=="*-del-on-*" #### 4. I'm embarrassed that I don't know how to write this. also prefix is being changed to suffix "*-del-on-yyyy-mm-dd.*" further down ####
A suffix needs more work to parse, and the usual solution breaks files with a ! in the name.
With a prefix the files also sort correctly by deletion date.
if you need to find a file with "this text" in the name you can use a batch file to show you the current full filename.
You mentioned that you have 80 GB HDD and these drives are also storing the data files, and that replacing them is not economical.
This leads me to think that the data is not backed up anywhere...