2
1
I want to make a scheduled process in Windows (specifically, Windows 7) that every 3 hours will delete all the files in all folders older than 24 hours (like the Unix find's -mtime +1
). Basically the Windows equivalent of having this configured in my Unix cron:
find $TRANSITDIR -mtime +1 -exec rm -rf {} \;
Although I seem to have found that the Windows cron equivalent is the scheduler, I just don't know the Windows commands to do that.
Does anyone have a scheduler script ready-to-go?
Related: http://superuser.com/q/434626/108226. The solution I posted (using PowerShell) can be fairly easily modified to work on any folder or drive, not just the recycle bin, and can be scheduled using the Task Scheduler GUI or the command-line
– Indrek – 2012-11-05T21:28:14.983schtasks.exe
.