|
Delet Files based on changing Filename
Hello All,
I am a newbie to batch files and mass deleting of files but an expirenced user of Windows Server 2003/Windows XP.
We have a folder on our shared drive that has a file for each day. Eg. 0112CANT.dfa, 0212FLEM.dfa. The filename is made up of DDMM????.*
I am trying to create a batch file that will delete files older than todays date by using the DDMM in the filename and NOT the date created/modified system date on the file. This is because in most cases a file will be created for a future date and i dont want to get rid of those future dates.
I have been doing it manually by changing the date in the batch file, but i need to automate this if possable.
This is what i have so far:
date /t >> cleanup.log
time /t >> cleanup.log
echo ***** Start of Cleanup of December Meetings *****
if exist \\risaserver\appsprod\prod\rsb\rsbdata\2712*.* del \\risaserver\appsprod\prod\rsb\rsbdata\2612*.* >> cleanup.log
if exist \\risaserver\appsprod\prod\rsb\rsbdata\2712*.* del \\risaserver\appsprod\prod\rsb\rsbdata\2712*.* >> cleanup.log
if exist \\risaserver\appsprod\prod\rsb\rsbdata\2812*.* del \\risaserver\appsprod\prod\rsb\rsbdata\2812*.* >> cleanup.log
Can someone help me please?
Melissa
|