• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

delete backup folder contents using Forfiles ?

master7045

Senior member
I need to write a script that will delete files in a directory that are older than 90 days. I found an exe that does this very will (delold.exe), but alas it doesn't work in Server 2000. I'm very new to batch, but have created some basic distro commands and such, so my feet are wet, so to speak.

I'm having a bit of trouble with the forfiles command though. Here is what I have:

FORFILES /P C:\NSB\Coalition\EDU\Backup\ /m *.* /d -90 /c "del /q /f"

When I run this, I get "ERROR: The system cannot find the file specified." I think this has something to do with my switch "/m *.*" Anything in this directory older than 90 days is useless, so I want to delete everything, not just specific file types. Any help is appreciated!
 
Sorry guys, figured it out. For those who care, here is what works:
FORFILES /P C:\NSB\Coalition\EDU\Backup /m *.* /d -90 /c "cmd /c del /q /f @path"

Thanks anyway!
 
Back
Top