I'm trying to put together a script to delete any files from a shared area that have been created more than 30 days ago. I have used the below scripts in a batch file from robocopy and from forfiles but neither seems to do what I want.
FORFILES /p c:\temp /s /m *.* /d -10 /c "cmd /c del /q @path"
OPY.EXE" c:\test\ c:\test\old /move /sec /e /XO /r:1 /w:1 /minage:30
The problem is that it deletes files older than 30 days when looking at the modified date not the created date. The idea is that the shared area is for transferring files from one server to another. Thus the created date is different to the Modified date.
Is there a way to delete files older than 30 days from the created date? See 'A' in attachment and not 'B' the modified date