Tech Sharing

Tech Sharing

Advertisement

How to schedule disk cleanup manager to run in Window XP/Server 2003?

By on December 16, 2010


Our computer are very smart and it will help us to enhance the user experience by creating some temporary file and store it in somewhere in your harddisk. So after sometime the un-used files, old temporary files, temporary Internet files, and any log file may use up a lot of space in your harddisk, in addition, those unwanted file may also slow down your computer performance. Keeping your harddisk clean and tiny is a way to mainteance your computer performance at the top.


This task seem easy but very time consuming as we may need to find out what files are useless for our computer and safe to delete without affecting our computer. Microsoft Window XP/2003 did provide a very user friendly tools for us to done the task call ‘Disk Cleanup Manager’.


You can get the tools at Start –> All Program –> Accessories –> System Tools –> Disk Cleanup.


But to using this tools, it need the human interaction which response to it on the spot in order to accomplish the job. Why not we make it run automatically at the time that the computer is free or idle without any response needed by the user.


To do so just following the following step:

  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
  3. On the Scheduled Task Wizard dialog, click Next.
  4. In the list of applications you want Windows to run, click Disk Cleanup, and then click Next.

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

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

  7. Enter the name and password of a user.
  8. Check the box to open Advanced Settings when you’re done.
  9. In the Run box, add the following to the end of the path: /sagerun: 1 and then click OK.
  10. Task Scheduler will automatically run Disk Cleanup with the settings you selected at the time you selected.
  11. Done

Done.

There are something you need to attention on which is the first command and switch you enter in the command prompt are difference with the extra command and switch you enter on the scheduler. The command enter in command prompt is /sageset but in the scheduler is /sagerun.


Syntax
CLEANMGR option
Options
/d driveletter: – Select the drive that you want Disk Cleanup to clean.
/sageset:n      – Display the Disk Cleanup Settings dialog box and create a registry key to store the settings you select.
The n value is stored in the registry and allows you to specify different tasks for Disk Cleanup to run.
n can be any integer from 0 to 65535. Specify the %systemroot% drive to see all the available options.
/sagerun:n       – Run task ‘n’
All drives in the computer will be enumerated, and the
selected profile will be run against each drive.
Only one of the 3 options above can be run at a time

Comments

No Responses to “How to schedule disk cleanup manager to run in Window XP/Server 2003?”

Write a Comment

Captcha *

%d bloggers like this: