For all you old "Dosasauruses" out there, here's a challenging batch file I'd like to get off the ground.
I would like to delete files in my two default Temp locations always from yesterday on back.
Is there a way to invoke "Dir" (inside the batch file) to separate the files as to date and send them to a staging folder where I can use "Del" to remove them?
There are always fresh temp files generated each bootup to prevent a del *.* scenario from working.
I've only been using XP for a couple of weeks and I found over a thousand garbage temps in both locations. I'd like to work toward the end of keeping that to a minimum; ergo the batch file idea.
for %%i in (dir c:\yourtempfoldernamehere /B /OD) DO del %%i
This will delete each file in the folder starting with the oldest. Since only the newest files generate an error because they're in use, it should solve your issue of avoiding del *.*. If I'm wrong in the assumption that you just can't do a del *.* because of in use errors, and there's another reason you need to keep the current day's files, then the above won't work.
I haven't done any extensive 'batch programming' in a few years so my syntax may be off for the 'for' command, but that's how it was done previously.
<font color=blue>Outside of a dog, a book is man's best friend. Inside the dog its too dark to read.
-- Groucho Marx</font color=blue>