How to Automate Disk Cleanup Using Task Scheduler in Windows?
Last Updated :
27 Sep, 2024
To keep your Windows system operating at its best, you must remove any superfluous files from it. Using Task Scheduler to automate disk cleanup is one of the simplest ways to make sure it happens regularly. By automating this repetitive task, you may avoid manually cleaning your computer and save time by ensuring that it remains clutter-free. Here's how to use Windows Task Scheduler to automate disk clearing.
How to Automate Disk Cleanup Using Task Scheduler in Windows?
To automate disk cleanup using a task scheduler, below are some steps:-
Step 1: Open Disk Cleanup Utility
- You should use the Disk Cleanup program to check which files you want it to remove before we arrange a scheduled task. You'll be able to precisely know what it will clear every time it runs in this manner.
Search for Disk Cleanup: Type "Disk Cleanup" into the Windows search box, then choose the Disk Cleanup application from the list of results. - Select Drive: Select the drive you wish to clean when promptedâtypically, the C: drive.
- Select items for Cleanup: The Disk Cleanup utility will examine your drive and present a list of items, including system files, temporary files, and contents from the Recycle Bin, that can be removed. Choose the file categories you wish to remove.
After making your selections for the files you want routinely cleaned, click "OK" to start the process. This is an important step that makes sure you remove the correct files and helps you understand what Disk Cleanup does.
Step 2: Launch the Task Calendar
One of the built-in Windows tools called Task Scheduler lets you automate several system activities, including Disk Cleanup.
- Launch the Task Scheduler: Open the application by typing "Task Scheduler" into the Windows search box.
- Make a New Assignment: Choose "Create Basic Task" from the Actions pane on the right side of the Task Scheduler window.
Step 3: Assemble the Work
A wizard will now walk you through setting up the automated Disk Cleanup operation.
- Give Your Task a Name: Then select "Next." Name your job something like "Automated Disk Cleanup."
- Select a Trigger: You must select the frequency at which Disk Cleanup will operate. Daily, weekly, monthly, or whenever your machine boots up are among the options. Weekly or monthly scheduling is usually a decent option for a regular chore like disk cleanup. After choosing your preferred frequency, press "Next."
- Decide on the date and time: Indicate the time you'd like the task to begin. You could program it to run every Monday at 3:00 PM, for instance. When finished, click "Next".
Step 4: Select an Action
This step involves instructing Task Scheduler on what to do, which is to launch the Disk Cleanup utility.
- Choose "Start a Program": Select "Start a Program" from the Action stage of the wizard, then click "Next."
- Select Disk Cleanup from the Program menu: To launch Disk Cleanup, enter the following command in the "Program/script" field:
cleanmgr.exe
- Optional: Add parameters: You can add more parameters, such as the following, to tell Disk Cleanup which drive to target and what kinds of files to look for.
/sagerun:1
The /sagerun:1 argument runs a preset cleanup defined in Disk Cleanup. You must first define this preset manually in Disk Cleanup using the command. cleanmgr.exe /sageset:1.
Step 5: Examine and Complete
Check the summary of your task settings, which includes the trigger, action, and time settings, once you've configured the job. After everything is in order, select "Finish."
Now that your job has been established, Windows will carry out Disk Cleanup automatically according to the schedule you provided.
Step 6: Check the Assignment
You can manually test your task by starting it right away to make sure everything goes as planned.
- Find the Task: To locate the task you just created in Task Scheduler, click on "Task Scheduler Library."
- Run the Task: "Run" can be selected by right-clicking on the job in order to start it right away. By doing this, you can make sure that the Disk Cleanup operates correctly with the parameters you specify.
Tips for Optimizing Disk Cleanup
- Customize Cleanup Settings: To generate custom cleanup profiles in Disk Cleanup, use the /sageset parameter. This enables you to target particular files, such as old Windows installations or transient internet files.
- Monitor Disk Space: Check your disk space regularly to see if the automated task is efficiently reducing clutter.
Automate Disk Cleanup Using Task Scheduler in WindowsConclusion
Task Scheduler may be used to automate Disk Cleanup so you can keep your Windows system organized and operating at peak efficiency without having to remember to run the utility by hand. It's an easy-to-use solution that you can set and forget about, keeping your system clear of superfluous files and guaranteeing improved performance over time.
Similar Reads
How to Automate Disk Cleanup Using Task Scheduler in Windows?
To keep your Windows system operating at its best, you must remove any superfluous files from it. Using Task Scheduler to automate disk cleanup is one of the simplest ways to make sure it happens regularly. By automating this repetitive task, you may avoid manually cleaning your computer and save ti
5 min read
How to Merge/Hide One File into Another Using CMD in Windows?
Merging or hiding files within other files using Command Prompt in Windows is a clever technique for managing and protecting your data. Whether you want to consolidate multiple files into one or conceal sensitive information, CMD offers powerful commands to achieve this seamlessly. Learning how to h
3 min read
How to Create a Bootable USB Flash drive in Windows/Linux using CMD?
Creating a bootable USB flash drive is an essential skill for anyone who needs to install an operating system, recover a system, or run diagnostic tools. Whether you're using Windows or Linux, the Command Prompt (CMD) offers a powerful and straightforward way to create a bootable USB using CMD in Wi
5 min read
How to clean install Windows 11 Version 22H2 ?
A clean install of Windows 11 24H2 provides a fresh and enriched experience while ensuring that your PC runs smoothly. Whether you're upgrading from an older version or making a fresh Windows 11 installation, this guide will walk you through the process of performing a clean install of Windows 11 24
7 min read
How to Automatically Delete Old Files in Windows 11?
Managing storage space efficiently is crucial for maintaining a smooth and responsive system. Windows 11 offers built-in features to help you automatically delete old files, freeing up valuable disk space without manual intervention. Whether you're looking to manage temporary files, downloads, or ot
6 min read
How to Create a Shut-Down Virus for Windows?
As the name of the virus is clear we are here trying to Create a simple shout-down Virus that is not harmful to the data that is saved in the computer this type of virus automatically restarts the PC when the user Login/Start the PC. This virus Automatically shout-down the PC till the time it is pro
2 min read
Backup & Restore Files using Windows File History
File History is an integrated backup system in Windows 10 and it replaced the earlier version of Windows Backup & Restore. One just needs a good size USB thumb drive or an external hard drive that is plugged in through the USB ports. Once it's plugged in, then the system will know that there's a
5 min read
How to Use Storage Spaces in Windows 11/10?
The Storage Spaces feature in Windows 11/10 allows you to combine multiple drives into a single virtual disk to enhance storage performance and redundancy. Whether you're using Windows 11 or Windows 10, learning how to use Storage Spaces can help you manage your storage efficiently. This guide will
6 min read
How to Create a Recovery Drive in Windows 11? (4 Simple Steps)
Creating a recovery drive in Windows 11 is an essential step to ensure you can troubleshoot and repair your system in case of any issues. This simple process allows you to create a bootable USB drive that contains the tools needed to fix problems, reset your PC, or restore your system. In just four
4 min read
How to Fix "Windows Cannot Access the Specified Device" Error in Windows?
Encountering the "Windows cannot access the specified device" error can be frustrating, especially when you need to access an important file or application. This common issue often arises due to permission settings, file location, or even antivirus software blocking the file. In this guide, weâll wa
6 min read