1.

Solve : How can I delete files by date in a batch file??

Answer»

I want to delete all files older than 72 hours in a specific folder on a windows 2003 server to prevent the log files from taking up too much space.

I used to write batch files like this, and I can't even parse it any more. Where is a good place to learn batch files today? Not that many people use them any more.

This is the command I REMEMBER, but can't parse:
FOR %%F IN (*.*) DO (
IF %%~zF LSS 1 DEL %%F
)

This deletes files less than 1 (byte or kb, not sure anymore) in size. I would need to find something similar by dates.

Back in the days I was PROGRAMMING (I am working on getting there again after a 15 year hiatus), I could write elaborate batch programs. I don't have the books any more, but need to find a way to clear the files from the log, or disable logging until after the problem has occured, and hopes it happens again. I would PREFER to leave the logging on.


I need to find a picture of an OLD geezer for an avatar. that is the way I feel recently



Discussion

No Comment Found