Delete files AND folders older then 7 days
Posted: Jul 6th, ’15, 11:52
Hi Marko
In the AHK forum I found a script that enables me to delete files older then 7 days (not tested yet)
I want to check my temp folder for files AND folders that are older then 7 days.
Can you please give me a hint on how to do that?
Thanks in advance for your support
Peter
In the AHK forum I found a script that enables me to delete files older then 7 days (not tested yet)
Code: Select all
StringLeft, Now_Date, A_Now, 8
;
Loop, %TEMP%\*
{
StringLeft, File_date, A_LoopFileTimeCreated, 8
If (Now_Date - File_date >= 7)
FileDelete, %A_LOOPFILEFULLPATH%
; FileRecycle, %A_LOOPFILEFULLPATH%
}
Can you please give me a hint on how to do that?
Thanks in advance for your support
Peter