Avatar of gtrapp
gtrapp
 asked on

Need .BAT file that deletes files based upon age of 10 days or older

I am using Windows 2000 Terminal server and like to have a .BAT file remove files 10 days or older. Howeve,r the FORFILES command does not work on Windows 2000 Terminal server. Any suggestions?
FORFILES /D -10 /M *.txt /C "cmd /c del @path 0x09 was changed 10 days ago"
echo Deleting .TXT Files 
echo File Deleted

Open in new window

CSSMicrosoft Legacy OSWindows 2000

Avatar of undefined
Last Comment
Member_2_921743

8/22/2022 - Mon
SOLUTION
Member_2_921743

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
gilou_s

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gtrapp

ASKER
Where do place the forefile.exe on the server?
gtrapp

ASKER
Thanks, got it working.
Member_2_921743

I think it should be ok to place it in the system32 folder or anywhere else. You might have to add it to the path environment so it can be recognized even if you are not in the same directory.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23