Please Wait...
Sponsored By :Tivad News.

Cleaning Up at the Command Line

Disk Cleanup offers some cool command-line switches that are documented only in a pair of obscure Knowledge Base articles. Through the use of these switches, you can save your preferences and rerun the cleanup process automatically using those settings. To do so, you need to use the following switches with Cleanmgr.exe :


  • /Sageset:n Opens a dialog box that allows you to select Disk Cleanup options, creates a registry key that corresponds to the number you entered, and then saves your settings in that key. Enter a number from 0 through 65535 in place of n.
  • /Sagerun:n Retrieves the saved settings for the number you enter in place of n and then runs Disk Cleanup without requiring any interaction on your part.
 To use these switches, follow these steps:
  • Open a Command Prompt window and type the command cleanmgr /sageset:200. (The number after the colon is completely arbitrary; you can choose any other number from 0 through 65535 if you prefer.) You must supply credentials from a member of the Administrators group to begin this task.
  • In the Disk Cleanup Settings dialog box, shown in Figure 21-11, choose the options you want to apply whenever you use these settings. (Note that the options in this dialog box are not the same as those shown in Figure 21-9.)
    Figure 21-11 When you use the /Sageset switch, you can work with an expanded set of options that are not available interactively.   

  • Click OK to save your changes in the registry.
  • Open Task Scheduler from Control Panel, and start the Create Basic Task wizard. Follow the wizard's prompts to name the task, and schedule it to run at regular intervals. When prompted to select the program you want Windows to run, enter cleanmgr.exe in the Program/Script box and enter /sagerun:200 in the Add Arguments box. 5.
Repeat steps 1-4 for other Disk Cleanup options you want to automate.

0 Comment:

Post a Comment

 
 
 
 
Copyright © Tivad News
Using Caribou Theme | Bloggerized by Themescook
This template is brought to you by : allblogtools.com | Blogger Templates