How To Run Disk Cleanup Automatically With Task Scheduler

How To Run Disk Cleanup Automatically With Task Scheduler

In our previous post, you can learn what a disk cleanup tool is and how to run it to free up disk space. The best thing is that you can automate this process using the Windows Task Scheduler.

Ideally, you should clean up your system regularly. If you can’t regularly run disk cleanup tool to remove unwanted files, free disk space in Windows by automating disk cleanup tool.

Scheduling disk cleanup in W11 including W10, XP and Vista is not a big task, if you know the right ways. Windows OS offers two built-in programs to cleanup Windows PC- Storage Sense & Disk Cleanup. Both tools work similarly and you can run these tools manually or automatically.

In today’s guide, you will learn how to schedule disk cleanup in W10 & W11 systems.

NOTE: Removing files using Disk Clean up tool will permanently delete files on your system and you can’t recover them without professional data recovery software. So, don’t forget to review files before deleting them.

What is Task Scheduler?

Windows task scheduler is a built-in tool for Windows OS based PCs that allows users to schedule automated tasks to run on specified intervals. With the help of this tool, you can run different tools and functions automatically without manual interference.

Benefits of Automating Disk Cleanup

Automating disk cleanup with Task Scheduler offers several benefits:

Convenience & Flexibility: It offers flexibility and convenience to run disk cleanup runs automatically without requiring manual intervention.

Consistency: It’s highly recommended to remove junk files and unwanted files regularly to improve system performance and free up disk space. Scheduled cleanups ensure that your system remains clutter free regularly and you don’t need to worry about it.

Optimized Performance: By regularly removing unnecessary files, disk cleanup helps maintain system performance and responsiveness.

Time Saving: Just automate the disk cleanup process, eliminate the need to remember to run disk cleanup manually, saving time and effort.

Run Disk Cleanup Automatically With Task Scheduler

To schedule disk cleanup automatically, you have to configure cleanmgr.exe with the command line to select what type of items you want to remove from your system. After that use the Windows schedule tasks function to run it at a specific time.

The schedule cleanup process will remove temp files, internet cache files, recycle bin and other unnecessary files on your desired date and time (daily, weekly, and monthly).

Step 01 Set Windows to Run Disk Cleanup Automatically

First, you need to set Windows to run disk cleanup process automatically using a command line. You can also consider it as a disk cleanup settings customization process. Before automating disk cleanup tool, customize the cleanup process by selecting which types of files to delete.

For this,

  1. Open the Command Window on your PC.
  2. Type or paste the below command in the Command window and hit the enter key.
cleanmgr.exe /sageset:1
Set Windows to Run Disk Cleanup Automatically
  1. The above command will open Disk Cleanup Settings Window on your PC screen. Check the items and select the files (items) you want to delete automatically using scheduled disk cleanup.
windows disk clean up automatically
  1. Finally, click “OK”.

Step 02 Schedule Task For Disk Cleanup

After configuring the disk cleanup settings, now it’s time to create a scheduled task. By creating a new schedule task in your Windows PC, the disk cleanup process will start automatically at specific intervals. Here you can set up disk cleanup schedule for daily, monthly, Weekly, when the computer starts, when logging on and when a specific event is logged.

  1. Open Windows Task Scheduler. For this, type task scheduler in search and open it from the result.
Windows Task scheduler
  1. Once the task scheduler opens on your screen, go to the “Action” tab >>> select the “create a bask task…” option.
create basic tasks
  1. Create A Basic Task Wizard” will open in front of you. Type the name for the task and description. (Example – Automatic Disk Cleanup). Click the “Next” button.

NOTE: The name of the task is a must and the description is optional.

automatic disk cleanup
  1. On the task trigger screen, select when you want to run the task.

Schedule disk cleanup frequency: Schedule disk cleanup program according to your usage patterns and disk space requirements. Ideally, you should run it weekly or bi-weekly.

Run Disk Cleanup Automatically
  1. In the next window, select the date and time of each month you want to run the task automatically and click “NEXT”.
Run Disk Cleanup Automatically With Task Scheduler
  1. Under the “Action” tab, select “Start a Program” and click “Next”.
How To Run Disk Cleanup Automatically
  1. Type or paste ws\system32\cleanmgr.exe in the “Program/script” section and /sagerun:1 in the “Add Arguments field” as shown in the below screenshot and click “Next”.
Disk Cleanup Automatically script
  1. In the next window, you will see a summary of the task you just created. Review it properly and then click “Finish”.
  2. Done!!! You have successfully created a scheduled task for disk cleanup on your PC. Now, the disk cleanup process will start automatically at the configured date and time.

Disk Cleanup Alternatives

Windows Disk Cleanup tool is designed to free up storage space on Windows OS based systems by removing unwanted and junk files. This tool scans the hard drive for temporary files, caches, logs and other data that can be safely removed without affecting the system’s functionality.

However, the problem is that the Windows Disk cleanup tool offers limited customization options to its users. If you want more control over this tool for deeper cleaning, better performance optimization or additional security measures, you should look for third-party cleanup tools.

There are several tools for disk cleanup. When you are going to select disk cleanup alternatives, you should consider the below points strongly.

  • Check compatibility with your current operating system
  • The tool must be User-friendly
  • Performance impact
  • Security features
  • Customer support and reliability

CONCLUSION

Automating disk cleanup with Task Scheduler is a simple and effective way to make your system clutter free. By scheduling regular cleanups, you don’t need to do anything manually. The automatic cleanup process will maintain peak performance and free up valuable disk space for you.

Do you know, you can limit the amount of disk space used by recycle bin in Windows 11 and Windows 10? Additionally, set up an automatically empty recycle bin to free up disk space.

Frequently Asked Questions (FAQs)

Can I customize which files Disk Cleanup removes?

Yes, the windows disk cleanup settings wizard allows you to choose which types of files to delete, including temporary files, system files, and more.

Will automated disk cleanup affect my system performance?

No, automated disk cleanup is a background process and it never affects your system performance during the process.

Can I schedule disk cleanup to run at specific times?

Yes, Task Scheduler allows you to run disk cleanup process according to your preferences. You can configure the tool for daily, weekly, and monthly including specific times.

What if disk cleanup fails to run as scheduled?

Check Task Scheduler error messages or issues with the task configuration. After that adjust settings or troubleshoot potential issues.

Leave a comment