Загрузка...

PowerShell to Automatically Delete Files Older Than x Days Using Task Scheduler

In this video, I’ll show you how to use Windows Task Scheduler along with a simple PowerShell script to automatically delete files older than a certain number of days from any folder you choose, such as Downloads, Temp, or custom directories you use regularly.👍
➡ This method is easy to set up and works silently in the background without any need for manual cleanup. It's perfect for automating maintenance tasks and keeping your system clutter-free over time.✅

➡ Keeping your Windows system clean from unnecessary or outdated files can significantly improve performance, free up disk space, and keep your environment organized. While ( Storage Sense ) is a useful built-in feature in Windows, it doesn’t let you target custom folders, which is a big limitation for many users.✅

💥 PowerShell Script Used in This Video :
-Command "Get-ChildItem -Path 'FOLDER_PATH' -File -Recurse -Force | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-NUMBER_OF_DAYS))} | Remove-Item -Force"

📌 Be sure to replace:

* `FOLDER_PATH` with the full path to your target folder
* `NUMBER_OF_DAYS` with how old the files should be before deletion (e.g., 30)

Related videos: 🔻🔻🔻🔻🔻🔻🔻🔻🔻
🎥 Clone Windows User Profile to Different Windows PC : https://youtu.be/Q7092jfFYfE
🎥 Set Up Passkey for Your Microsoft Account : https://youtu.be/y8z7DEM_WzA
🎥 Restore Windows Photo Viewer in Windows 10 : https://youtu.be/_1NuJTmHkF0
🎥 Extract Text from an Image Using the Snipping Tool : https://youtu.be/BG4Ai6TGyu4
🎥 Uninstall & Reinstall Microsoft Store : https://youtu.be/2oeHAMq-55A
🎥 Command Line to Change or Set DNS Server : https://youtu.be/kER1BtR60Xg
🔺🔺🔺🔺🔺🔺🔺🔺🔺🔺
🔻🔻🔻
📌 If you find this video helpful, don’t forget to **like 👍, share 🎥 , and subscribe 🔔** to my channel for more IT tips and tutorials! 😊
----------------------------------------------------------------------------------------------------------------
#howto #doit_mostafa #windows10 #windows10tips #windows11tips #windows11 #powershellscripting #powershell #taskscheduler

How to Automatically Delete Files Older Than 30 Days Using Task Scheduler,
How to Use PowerSell to Automatically Delete Files Older Than x Days,
PowerShell Script to Automatically Delete Files,
Automatically Delete Old Files in Windows with PowerShell and Task Scheduler,
Delete Files Older Than X Days Automatically With Task Scheduler,
Auto Delete Old Files from Any Folder Using Task Scheduler,
Delete Files After x Days Automatically,
How to Create powershell Script to Delete Files by Date on Windows,
Task Scheduler Tutorial, Windows Automate File Cleanup,
Task Scheduler PowerShell Command,
How to Delete Old Files Automatically on Windows,
Windows performance tips,
Scheduled cleanup Windows,
How To Use Task Scheduler To Delete Files Older Than X Days,
How to Automatically delete files older than 30 days using task scheduler,
Windows task scheduler delete files older than x days,
Automate file deletion in windows using powershell,
Powershell script to delete files older than 30 days,
Task scheduler powershell script to clean up old files,
How to use windows task scheduler to delete old files,
Automatically delete files from downloads folder after 30 days,
Delete temporary files older than x days using task scheduler,
Powershell command to delete files older than 30 days recursively,
Windows 11 automatically delete old files from folder,
Create scheduled task to delete old files windows,
Windows 10 task scheduler delete files after certain days,
Clean up downloads folder automatically using task scheduler,
How to delete files automatically in windows 11,
Delete files older than 30 days windows 11 task scheduler,
Set up task scheduler to delete old files in windows,
Automate windows cleanup with task scheduler and powershell,
Schedule daily file deletion task in windows,
Script to remove files older than 30 days from specific folder,
Windows powershell and task scheduler cleanup tutorial,
----------------------------------------------------------------------------------------------------------------
Can See More Videos: https://www.youtube.com/channel/UCaleTzdu_LPp3EC7XCOiNIw/videos
----------------------------------------------------------------------------------------------------------------
Music In Video : https://www.youtube.com/audiolibrary_download?vid=ce97efb610798cb9
-----------------------------------------------------------------------------------------------------------
Thanks For Watching
Please Like and Subscribe
Thank you for the Support
📢 Don’t forget to subscribe to my channel, for more tech tutorials, tips, and solutions!
SHARE, SUPPORT, SUBSCRIBE ✅

Видео PowerShell to Automatically Delete Files Older Than x Days Using Task Scheduler канала DO IT / mostafa ahmed
Яндекс.Метрика

На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.

Об использовании CookiesПринять