Disk Cleanup
Encyclopedia
Disk Cleanup is a computer maintenance utility included in Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 designed to free up disk space on a computer's hard drive. The utility first searches and analyzes the hard drive for files that are no longer of any use, and then removes the unnecessary files. There are a number of different file categories that Disk Cleanup targets when performing the initial disk analysis:
  • Compression of old files
  • Temporary Internet files
  • Temporary Windows file
  • Downloaded Program files
  • Recycle Bin
  • Removal of unused applications or optional Windows components
  • Setup Log files
  • Offline files


The above list, however, is not exhaustive. For instance, 'Temporary Remote Desktop files' and 'Temporary Sync Files' may appear only under certain computer configurations, differences such as Windows Operating System and use of additional programs such as Remote Desktop
Terminal Services
Remote Desktop Services in Windows Server 2008 R2, formerly known as Terminal Services in Windows Server 2008 and previous versions, is one of the components of Microsoft Windows that allows a user to access applications and data on a remote computer over a network, using the Remote Desktop...

. The option of removal hibernation data may not be ideal for some users as this may remove the hibernate option.

Aside from removing unnecessary files, users also have the option of compressing files that have not been accessed over a set period of time. This option provides a systematic compression scheme. Infrequently accessed files are compressed to free up disk space while leaving the frequently used files uncompressed for faster read/write access times. If after file compression, a user wishes to access a compressed file, the access times may be increased and vary from system to system.
In addition to the categories that appear on the Disk Cleanup tab, the More Options tab offers additional options for freeing up hard drive space through removal of optional Windows components, installed programs, and all but the most recent System Restore
System Restore
System Restore is a component of Microsoft's Windows Me, Windows XP, Windows Vista and Windows 7, but not Windows 2000, operating systems that allows for the rolling back of system files, registry keys, installed programs, etc., to a previous state in the event of system malfunction or failure.The...

point or Shadow Copy data in some versions of Microsoft Windows.

Use

Windows Disk Cleanup can be used in 2 ways.

Method 1
  • Select the program from Start Menu > All Programs > Accessories > System Tools

Here you can select to cleanup the following areas:
  • Downloaded Program Files
  • Temporary Internet Files
  • Offline Webpages
  • Recycle Bin
  • Temporary Files
  • WebClient/Publisher Temporary Files
  • Temporary Offline files
  • Offline files
  • Compressed old files


Method 2

The second option allows you to predefine what areas are to be cleanup, store these settings in the registry so that Disc Cleanup can be run at a later date using a command line option that uses your predefined selected areas. This method also allows you to export the registry settings and place them in some sort of script to be imported to remote machines, i.e. at shutdown or maybe even create a weekly task. When using this method the user will still see the 2 box's to show the cleanup process examining the the system and running the cleanup schema
  • Select Start Menu > run

Type the following command
cleanmgr.exe /d c /sageset:1

cleanmgr.exe - request the program
/d - um, I dont know, its just needed
c - states the drive to cleanup - though it seems to just do them all whenever I use it
sageset: - defines this command as a registry entry to record
The digit one - or any number, this allows you to create more then one schema to save settings under
using the above command give you the following extra areas to cleanup that are not available using method 1
  • Debug Dump Files
  • Old ChkDsk Files
  • Temporary Remote Desktop files
  • Setup log files
  • Catalogue files for the Content Indexer

To execute your predefined areas to cleanup use the following command:

cleanmgr.exe /d c /sagerun:1

Sagerun: - states that this command is to be run and not saved in the registry

The digit one - states what pre defined selections to use
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK