I am looking for a way to delete all files older than 7 days in a batch file. I\'ve searched around the web, and found some examples with hundreds of lines of code, and oth
My command is
forfiles -p "d:\logs" -s -m*.log -d-15 -c"cmd /c del @PATH\@FILE"
@PATH
- is just path in my case, so I had to use @PATH\@FILE
also forfiles /?
not working for me too, but forfiles
(without "?") worked fine.
And the only question I have: how to add multiple mask (for example ".log|.bak")?
All this regarding forfiles.exe that I downloaded here (on win XP)
But if you are using Windows server forfiles.exe should be already there and it is differs from ftp version. That is why I should modify command.
For Windows Server 2003 I'm using this command:
forfiles -p "d:\Backup" -s -m *.log -d -15 -c "cmd /c del @PATH"