0
我正在處理將數據下載到Downloads目錄的應用程序,在某些時間段之後不再需要該目錄。有沒有辦法在一段時間內刪除這些下載的文件?如何從下載目錄安排刪除數據 - Windows
我正在處理將數據下載到Downloads目錄的應用程序,在某些時間段之後不再需要該目錄。有沒有辦法在一段時間內刪除這些下載的文件?如何從下載目錄安排刪除數據 - Windows
** open into note pad and
delete script : **
REM Remove files older than 30 days
forfiles /p 「C:\deletefolder name」 /s /m *.* /c "cmd /c Del @path" /d -30
1 . Here C:\deletefolder path folder and save file name (like downloadcleanup.bat)with .bat extension
2 . Open tack scheduler
3.Right Click to Task Scheduler option and then select new tack schedule
4. Select .bat file path you have saved
5.and also you can see step into below images:
6. Continue to finish and you can seen your tast in your task scheduler and select to run at a time and also run automatically by schedule time
[1]: https://i.stack.imgur.com/Em8f5.png
[2]: https://i.stack.imgur.com/EXn9b.png
[3]: https://i.stack.imgur.com/ZqaCe.png
[4]: https://i.stack.imgur.com/S8Lxy.png
[5]: https://i.stack.imgur.com/lGqxX.png
[6]: https://i.stack.imgur.com/QGFRL.png
[7]: https://i.stack.imgur.com/a0RRq.png
[8]: https://i.stack.imgur.com/8L0NC.png
[9]: https://i.stack.imgur.com/7v9SV.png
你可以寫在你最喜歡的語言(例如PowerShell的或Python)腳本,將定期檢查下載目錄,並刪除基於它們的時間戳不必要的文件。但是,您應該小心,並徹底測試您的腳本 - 您必須確保它按預期工作,並且不會刪除仍然是實際的文件。