Disk Management

How can I schedule the Disk Cleanup wizard to run automatically in Windows XP/2003?

Your computer stores its data on hard disk(s). Disks can accumulate a lot of un-used files, old temporary files, temporary Internet files, old setup files and more. Keeping your disks clean and tidy is a task that can be done manually (by those of you who know what to delete – not any file can be manually and most important – safely – deleted without knowing what exactly your computer no longer needs), but since it tends to take a lot of time, it is best to schedule it to automatically run while you are asleep or away from your computer.

BTW, disk maintenance is also covered in the Schedule Disk Defragmenter to Run Automatically in Windows XP/2003 article.

Windows XP/2003 contain a nice GUI-based utility called the Disk Cleanup tool. It can be found by clicking Start > All Programs > Accessories > System Tools > Disk Cleanup.

You can run the tool by clicking it and manually following the prompts, but doing so requires that requires human intervention. Why not schedule it to run automatically?

Sponsored Content

Passwords Haven’t Disappeared Yet

123456. Qwerty. Iloveyou. No, these are not exercises for people who are brand new to typing. Shockingly, they are among the most common passwords that end users choose in 2021. Research has found that the average business user must manually type out, or copy/paste, the credentials to 154 websites per month. We repeatedly got one question that surprised us: “Why would I ever trust a third party with control of my network?

In order to schedule the Disk Cleanup tool to automatically run perform the following steps:

  1. Click Start Menu > Run, then type cleanmgr /sageset:1
  2. Click OK.

Disk Cleanup opens with a list of the possible files to be deleted. Select a file type to display a description. Check the boxes for the files you want removed, and click OK.

Next, you need to schedule Disk Cleanup to run when you want it to.

  1. Open Control Panel, double-click Scheduled Tasks
  2. Double-click Add Scheduled Task

  1. On the Scheduled Task Wizard dialog, click Next.

  1. In the list of applications you want Windows to run, click Disk Cleanup, and then click Next.

  1. Select a frequency for the task (once per week is usually enough) and click Next.

  1. Select a day of the week and time for the task to run.

  1. Enter the name and password of a user.

  1. Check the box to open Advanced Settings when you’re done.

  1. In the Run box, add the following to the end of the path: /sagerun: 1 and then click OK.

  1. Task Scheduler will automatically run Disk Cleanup with the settings you selected at the time you selected.

Done.

Further Reading

You may find these related articles of interest to you:

Related Topics:

BECOME A PETRI MEMBER:

Don't have a login but want to join the conversation? Sign up for a Petri Account

Register
Comments (1)

One response to “How can I schedule the Disk Cleanup wizard to run automatically in Windows XP/2003?”

Leave a Reply

Don't leave your business open to attack! Come learn how to protect your AD in this FREE masterclass!REGISTER NOW - Thursday, December 2, 2021 @ 1 pm ET

Active Directory (AD) is leveraged by over 90% of enterprises worldwide as the authentication and authorization hub of their IT infrastructure—but its inherent complexity leaves it prone to misconfigurations that can allow attackers to slip into your network and wreak havoc. 

Join this session with Microsoft MVP and MCT Sander Berkouwer, who will explore:

  • Whether you should upgrade your domain controllers to Windows Server
    2019 and beyond
  • Achieving mission impossible: updating DCs within 48 hours
  • How to disable legacy protocols and outdated compatibility options in
    Active Directory

Sponsored by: