I need to delete files older than two days inside a folder, except files last modified the 1st of each month. Forfiles does not support exceptions. Operating System is Windows Server 2003. Any idea?
Thank you all for help!
Quick and dirty VBScript here, it assumes UK date format for enumerating if the file is from the 1st of the month. If you use a different date format then change the trim command to grab the appropriate number positions. For example, a US date would be Mid(objFile.DateLastModified, 4, 2) = 01 rather than Left(objFile.DateLastModified, 2) = 01
Anyway, sorry for the dirty code... but it should get you started.
I'd say that would be dependent on your familiarity and comfort with programming/scripting languages.
Both of those examples came from Googling powershell delete files older than or python delete files older than ...in case you wanted to check for alternatives.
I'm not familiar with any GUI tools or quick setup tools to do such, as I've never really needed them. All of what you ask can be coded out in less than 20 lines in most cases.