간략한 사용법

 

cleanmgr /sageset:n

디스크 정리의 자동화를 설정합니다. 자동화 항목(n)은 1~65536 까지 설정할 수 있습니다.

이곳에서 입력한 번호는 자동화 번호가 되며 이후 해당 번호를 통해 미리 설정한 항목들을 자동으로 정리하게 됩니다.

WinKey + R 을 클릭하여 실행 창을 띄운 후 다음의 명령을 내려줍니다. 입력 후 설정창이 뜨면 원하는 항목을 체크합니다.

cleanmgr /sagerun:n
디스크 자동 정리를 시작합니다. 이 때 n 항목은 미리 설정이 되어 있어야 합니다.

 

cleanmgr /tuneup:n
설정된 디스크 정리 자동화 항목(n)의 설정을 수정합니다. 이 때 n 항목은 미리 설정이 되어 있어야 합니다.

 

-----------------------------------원문------------------------------------------------------------------------------------------------------------------------

CLEANMGR.exe

 

Automated cleanup of Temp files, Internet files, downloaded files, recycle bin.

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

      /TUNEUP:n        Run sageset + sagerun for the same n

      /LOWDISK         Run with the default settings.

      /VERYLOWDISK     Run with the default settings, no user prompts.

      /SETUP           Undocumented
      /Help            Undocumented
      /Usage           Undocumented
      /?               Display help

To enable Cleanmgr on Windows 2008, open Server Manager and choose Add feature, then select "Desktop Experience"
 After running cleanmgr on a server you will probably want to disable "Desktop Experience" again (or use this script.)
 When necessary cleanmgr can take ownership of the files before deleting them.

Registry settings for CLEANMGR are held in:
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches]

Examples

CLEANMGR /sageset:64

CLEANMGR /sagerun:64


Options that can be chosen for cleanup:


 Temporary Internet Files
 Temporary Setup Files
 Downloaded Program Files
 Old Chkdsk Files
 Recycle Bin
 Temporary Files
 Temporary Offline Files
 Offline Files
 Compress Old Files
 Catalog Files for the Content Indexer
 System files: Debug/chkdsk/Installer/Memory dump/Windows update/error reporting logs.

Items in bold can appear in more than one drive i.e not just in %SystemRoot%

 

Application Data

Many files in Application Data hold system data that should not be deleted, however some applications do leave files which you can delete from a roaming profile, these can be selectively removed with a VBScript like this.

Recent files

The 'User Profile/Recent' folder (for Start, Documents) can contain many more shortcuts than are set to display in the GUI. A very large number of these can affect logon/logoff times.
 To clear out the shortcuts:
    cd %userprofile%\Recent 
    echo y| del *.*

Close Locked files by restarting Windows Explorer


Close all applications
Open a command prompt
Type:
taskkill /im explorer
This should kill explorer and bring up a logout/shutdown dialogue box.
Simultaneously press CTRL+SHIFT+ALT.
While you keep these keys pressed, click [Cancel] in the Shut Down Windows dialog box.
In the command prompt window, you should now be able to delete the locked files.
At the command prompt, type explorer, and press ENTER to restart Windows Explorer.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------

출처

http://ss64.com/nt/cleanmgr.html

https://support.microsoft.com/en-us/kb/253597

https://support.microsoft.com/en-us/kb/315246

Posted by 인생역전로또
: