Scheduled Disk Cleanup. CLEANMGR - Windows Disk Cleanup Manager Windows 7 disk cleanup command


If programs take longer to load, and the computer slows down during each subsequent operation, you need to clean up the system drive C from "garbage". Unused software products, remnants of incorrectly deleted software and files, saving errors due to disk fragmentation are the main reasons for uncomfortable working with a PC. Let's figure out how to clean up the system drive C from unnecessary files and programs?

Standard Windows Features

In the course of working with a computer, the user installs and updates the software. Some programs are used daily, others several times a month, and others are forgotten after 1-2 weeks. It is from the latest software products that you should get rid of in the first place, using any available methods. Namely:

Manual

First of all, empty the "Trash", "Downloads" and the "Temp" folder. These are three large stores of temporary and unnecessary files. You can get to the "Temp" folder using the search bar by pressing WIN+R. Next, they act like this:
  • On an empty line write " %Temp%" (without quotes);
  • enter;
  • On the window that appears, use the keyboard to type a combination of keys Ctrl+A;
  • Then the key combination Shift+Delete.


Important! Not all files will be deleted in the folder, but only those that are not involved in the course of the programs. A full cleaning can be performed before turning off the PC, after closing all programs.

The "Temp" folder is located on the system C, it can also be found manually. It is also recommended to release user folders, OS storages. All of them are located on the main disk. But when manually deleting objects, you need to be extremely careful, otherwise there is a high probability of erasing the system file, without which the OS will not boot.

Important! Do not remove objects with an unfamiliar extension in the windows.old folder - files for system recovery are stored here.

Using Disk Cleanup

A safe and easy way to clean up your system C is to use the Properties tab. If the manual method of cleaning is dangerous because it can erase an important object for the OS, then using the built-in functions is absolutely safe. Do the following:
  • Find folder " My computer» and open;
  • Right click on disk C;
  • From the vertical menu select " Properties»;
  • « Clean up disk”, and in the new window, check all menu items;
  • Press " OK" confirm deletion.


In the Disk Cleanup window, you can also destroy the accumulated junk in system files. To do this, select the "Clean up system files" button. The procedure is safe, but may take 1 to 15 minutes. This is fine.

deep stonecrop

It is carried out using the command line, which is called through the search line on the Start panel. Here you need to enter cmd characters in English. Next, do the following:
  • In the "black" window that opens, enter the term: " %systemroot%\system32\cmd.exe /c cleanmgr/sageset:65535 & cleanmgr/sagerun:65535»;
  • Press Enter;
  • Waiting for the process to complete.


This command will open a window with a large list of files. So the process has begun. You do not need to close the command line until the procedure is complete.

Third-party resources to clean up the system and other drives

On the network you can find paid and shareware software products to optimize free space. If a home PC is being serviced, the second type of utilities is also perfect - less functionality, but free download. Reliable and easy to use include:
  • CCleaner and Advanced;
  • PC Booster and Ashampoo WinOptimizer Free;
  • SlimCleaner Free and Comodo System Utilities;
  • Auslogics Boost Speed ​​and Glary Utilities;
  • Kaspersky Cleaner and Clean Master for PC.
Often use CCleaner. Its free functionality is enough for regular PC maintenance. Not so long ago, a new and rather interesting Clean Master for PC program appeared. Despite the English-language interface, it is very simple and straightforward to use. Great alternative to CCleaner and more suitable for beginners. The free package can be downloaded from the developer's website. Installation of the utility is standard. After installation, proceed as follows:
  1. We wait until the utility automatically scans the disks;
  2. In the new window, click " clean now»;
  3. We are waiting for the report;
  4. Close the program.

In the course of its operation, the operating system creates a lot of temporary data that is stored on the disk (usually drive C) in the form of files and registry entries. These can be service pack files, archivers, shadow copies, content downloaded from the Internet, etc. Third-party programs behave in a similar way, for example, browsers that cache website data. Some temporary files are deleted automatically after a certain time, others remain on the disk until they are deleted forcibly.

If the user does not perform regular maintenance and cleaning of the C drive, free space on it becomes less and less, to the point that the disk eventually turns out to be filled with temporary files to the eyeballs, which excludes further writing of any data to it and reduces its performance. There are two ways out of the current situation - either to increase the size of the system partition due to the user volume, or to perform its complex cleaning, which is more preferable. Let's see how to free up space on the local drive C in Windows 7/10.

What can be removed if the disk is full

The system volume contains many important files that ensure the normal operation of Windows, so deep cleaning should be approached with the utmost care. What can be removed from the C drive to free up space and not break the system? All its content can be conditionally divided into three groups. The first includes files that can be deleted without any fear. The second consists of files, the removal of which, although it will not harm the system, but under certain circumstances can still cause certain problems. The third group includes files that cannot be deleted, as this can make programs and the system inoperative. You can clean drive C without negative consequences by deleting:

  • Contents of the Cart.
  • Library catalogs.
  • Folders and Downloaded Program Files in the Windows directory.
  • Cache of browsers and some third-party programs.
  • Icon sketches.
  • Logs and memory dumps for system errors.
  • Old Chkdsk utility files.
  • Bug reports.
  • Files created by the Windows debugger.

With some care, you can delete shadow copies () created during the installation of updates and stored in backup copies, files of previous system installations (Windows.old folder), unnecessary components and applications, folders of uninstalled programs in the ProgramData, Program Files and Roaming directories, MSOCache Microsoft Office folder. If quick start is not used, you can delete the file hiberfil.sys in the root of drive C, after disabling these functions in the settings. It is acceptable, but not desirable, to remove the swap file pagefile.sys. Other files and folders on the C drive must not be deleted so as not to disrupt the system.

Cleaning up junk and temporary files using Windows tools

To begin with, let's see how to clear the C drive of unnecessary files in Windows 7/10 using the operating system itself. For this purpose, Windows has a built-in utility. cleanmgr.exe, which can be launched both through the properties of the section being cleared, and through the Run dialog box. After the utility scans the disk for obsolete files, check the boxes on the Disk Cleanup tab and click OK.

If you click the "Clean up system files" button, reports, device driver packages, error dumps, and additionally, restore points, with the exception of the most recent one, will become available for deletion.

For a deeper and more thorough cleaning of disk C from garbage, you can use the built-in console utilities Dism and vssadmin. The first allows you to delete temporary data from the WinSxS folder, including backups created before installing Windows updates. To do this, use the following commands, executed in the CMD console launched as an administrator:

  1. DISM.exe /online /Cleanup-Image /StartComponentCleanup
  2. DISM.exe /online /Cleanup-Image /SPSuperseded
  3. vssadmin delete shadows /all /quiet

The first command does the same as the cleanmgr.exe utility, only more carefully.

The second removes all standby updates from the WinSxS folder.

With the third command, you can delete all restore points, including the last one.

However, you should use these tools with caution, because after executing the indicated commands, you will no longer be able to roll back the system to a working state or previous version.

Note: before clearing the WinSxS folder, it is recommended to set it to its true size, thereby making sure that it really needs to be cleared. To do this, run the command on the command line Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore and compare the actual size of the component store with the size indicator in the Explorer properties.

After updating Windows to a newer version, a folder appears in the root of drive C Windows.old, which can take up a lot of disk space.

The contents of this directory are copies of the installation system files of the previous version of Windows. If you are determined not to return to the old version of the system, the Windows.old folder can be deleted. This is done again either using cleanmgr.exe or using the command line. In the first case, you need to find and mark the “Previous Windows installations” item on the “Advanced” tab, in the second, run the command in the CMD console launched as an administrator rd /s /q c:/windows.old.

You can get some extra space on the C drive by removing unused components, the same ones that the classic Add/Remove Programs applet provides access to.

The regular Dism utility is also involved here. To select and uninstall an unused Windows component, run the following two commands in an elevated CMD console:

  1. DISM.exe /Online /English /Get-Features /Format:Table
  2. DISM.exe /Online /Disable-Feature /featurename:NAME /Remove

The first command lists all components in the system, the second deletes the selected item. In this example, its name must be substituted for the NAME string element.


Manual removal of programs and files

With the exception of Windows 8.1 and 10 Universal Apps, almost all desktop programs are installed in the folder Program Files. If the program is no longer needed, it should be removed so that it does not take up space on the disk, but you need to do this either with the help of a standard uninstaller or with the help of special third-party programs. However, after uninstalling applications, their folders with configuration files may remain on the disk, the weight of which can reach several hundred megabytes. Such data must be deleted manually.

Let's say you have removed Microsoft Office or Skype from your computer and want to get rid of all their "tails" remaining on the C drive as well. To do this, carefully check the Program Files and ProgramData directories in the root of drive C, as well as the folders C:/Users/UserName/AppData. If the folder name matches the name of the remote application, it can be deleted.

With the AppData folder, things are a little more complicated. This hidden directory contains three subfolders: Local, LocalLow, and Roaming. The first stores files created during the operation of various programs. You cannot clear it entirely, as this will certainly lead to the loss of saved application settings, however, half-empty folders of uninstalled programs can be safely deleted. You can also safely clear the contents of the folder located in it. Temp.

The same applies to the LocalLow and Roaming folders, only those directories that belonged to previously uninstalled applications can be deleted from them.

Note: clearing the contents of the Local, LocalLow and Roaming folders, you lose user settings and data stored in their cache. For example, after deleting its folders in the user profile, you will lose the current messenger settings and part of the message history.

As for the removal of universal applications, they are uninstalled by the regular means of the system itself or by the CCleaner program, which will be discussed below. You can also move some universal applications from drive C to drive D if they support this feature.

Transferring desktop programs to another volume is also possible, for these purposes there is a special utility Steam Mover, which you can download from the developer's site www.traynier.com/software/steammover.

Using CCleaner

Many novice users are interested in how to delete unnecessary files from drive C using third-party programs, as well as which of these programs are more efficient and safe in this regard. These can be recommended CCleaner is a simple, fast, convenient, and most importantly safe Windows disk and registry cleaner. This program allows you to delete temporary data from the Internet and Windows itself, the contents of the thumbnail cache and DNS, Index.dat files, memory dumps, fragments of chkdsk files, various system logs, obsolete prefetch files, and a lot of other secondary data.

With CCleaner, you can clean the system registry of invalid entries, optimize, enable, disable or remove browser extensions, analyze the contents of hard drives, search for duplicates and, of course, uninstall unnecessary applications, including universal ones.

CCleaner's interface is very simple, so even a novice user can easily figure out its simple functionality.

Considering, however, that the main purpose of CCleaner is still cleaning, all its additional tools have limited functionality. If your C drive is clogged with something incomprehensible, and you want to find out what exactly, then for these purposes it is better to use specific utilities, for example, Scanner, JdiskReport or their analogues, showing more accurate information about the file structure of the media with the ability to navigate through subdirectories.

Other ways to free up space on the C drive

Clearing the Driver Store

The steps described above are usually enough to free up enough space on the system volume, but what if drive C is still full? What else can you do to get more space? One option is to clear the contents of the folder FileRepository located at C:/Windows/System32/DriverStore.

This directory contains copies of device drivers that have ever been connected to the computer, and may also contain outdated versions of drivers. Before deleting driver packages from the FileRepository folder, it is highly advisable to create a complete list of them and find only obsolete versions in it, and leave the rest untouched. It also does not hurt to create a complete copy of all drivers installed on the system. To list the DriverStore drivers in a file, run the following command from an elevated command prompt:

pnputil.exe /e > C:/drivers.log

Compare the driver versions in the list and remove only the outdated ones.

To remove the selected driver, immediately execute the command in the console pnputil.exe /d oem#.inf, where # is the name of the driver in the list.

If you get an error in the console when uninstalling the driver, then the driver is in use by the system. It is not necessary to touch such a component.

As an alternative to the command line, you can use the free utility Driver Store Explorer, just designed to remove old unused device drivers.

Disabling hibernation

Thanks to the hibernation mode, the user can quickly return to working in running applications, on the other hand, its use requires the allocation of a significant amount of space on the system disk, slightly less than or equal to the amount of RAM. If the availability of free space on the hard drive is a priority for you, hibernation can be disabled by deleting the hiberfil.sys container file.

Launch the CMD console as an administrator and run the command in it powercfg -h off. Hibernation will be disabled and the cumbersome hiberfil.sys file removed.

Note: the hibernation file can be compressed by a maximum of two times with the command powercfg hibernate size 50.

Disabling the paging file

In addition to other hidden system objects, there is also a file in the root of drive C that can be deleted under certain conditions. This is the swap file pagefile.sys. This file plays the role of a RAM buffer and if some application does not have enough RAM for its work, its data is temporarily written to . Accordingly, if there is no swap file, a heavy application will slow down a lot or simply hang, waiting for faster RAM to be released. Therefore, disabling and deleting the paging file is not recommended, unless the computer has a very large amount of RAM.

If your PC has more than 10 GB of memory or you are not going to run resource-intensive applications, you can try to carefully disable swap. To do this, open Advanced system settings and on the "Advanced" tab in the "Performance" block, click the "Settings" button.

This will open another window. Switch to the "Advanced" tab in it, and then click the Change button in the "Virtual memory" block.

Uncheck the "Automatically select the size of the paging file" checkbox, turn on the "No paging file" radio button, save the settings and reboot. The pagefile.sys file will be deleted.

Deleting the MSOcache folder

Users who have installed Microsoft Office have a hidden folder in the root of the system volume MSOcache, the weight of which can reach several gigabytes.

This folder is the cache of the office suite and contains files that may be needed to restore Microsoft Office if it becomes corrupted. The MSOcache folder is not involved in starting Microsoft Office or working with documents, so it can be deleted in the standard way. Please note that if Microsoft Office is damaged for some reason, you will have to restore the package from the installation disk with its distribution.

Compressing the contents of the system volume

You can free up some free space on drive C without deleting anything at all. Instead, all system files can be compressed. To do this, just open the properties of drive C, on the "General" tab, check the box "Compress this drive to save space" and click "OK".

To compress system files in Windows 10, you can use the function Compact OS by executing one of two commands in the CMD console launched as an administrator:

  • compact /CompactOs:query
  • compact /CompactOs:always

The second command performs the same actions as the first, but in forced mode. It is used if you really want to compress the system volume, and the first command rejects the operation, considering it inappropriate. Compression is quite reversible and to return the file system to its normal state, it is enough to execute the reverse command compact /CompactOs:never.

In addition to NTFS compression, LZX compression is available in Windows 10, but it has a number of drawbacks, due to which it is not widely used. LZX compression is applicable to read-only files and directories, but an entire system volume cannot be compressed with it due to the risk of resulting in an unbootable system.

In the process of using the operating system, a lot of files accumulate on the hard disk that are no longer used, but still remain on the disk, gradually reducing the amount of free space and ultimately leading to system "brakes". To reduce the number of unused files on your hard drive to free up disk space and improve computer performance, use the program "". It deletes temporary files, empties the Recycle Bin, and removes many system files and other unused items.

To run the program, press the WIN + R keys and enter the command cleanmgr and OK

Now select the drive you want to clean up. This is usually the C drive.

In the window that opens, click the button for a more complete disk cleanup. In the Disk Cleanup: dialog box, select the hard disk you want to clean up again, and then click OK. A new tab will appear in a new window Additionally».

The next step is to select the checkboxes for the types of files you want to delete and click OK. In the message box, click the button

Tab « Additionally” is available when you select to delete files for all users of the computer. This tab contains two additional ways to free up even more disk space.

Programs and Features. Opens the Programs and Features component of the Control Panel, where you can uninstall unused programs. The Size column in Programs and Features shows how much disk space is being used by each program. You can also remove unused Windows components there.

System Restore and Shadow Copy. Delete all restore points from the disk, except for the most recent one. System Restore uses restore points to restore system files to a previous state. If your computer is running smoothly, you can delete earlier restore points to free up disk space. In some editions of Windows 7, restore points may include previous versions of files, called shadow copies, and images of archives created using Windows CompletePC Backup. These files and images will also be removed. For more information about System Restore, search for "System Restore" in Windows Help and Support.

Schedule Disk Cleanup to run automatically

To create an automatic launch of the Disk Cleanup program, press WIN + R and enter the command mmc.exe taskschd.msc and OK

This command starts the Task Scheduler. Task Scheduler is an MMC snap-in that allows you to assign auto-running tasks that run at a specific time or when certain events occur. The Task Scheduler contains a library of all scheduled tasks, providing quick viewing and easy task management. You can run, disable, edit, and delete a job from the library.

Now we need to create a new task. On the menu Action select . The New Simple Task Wizard dialog box opens.

A window will open Wizards for creating a simple task. Enter the name of the task and, if necessary, a description. Click next.

The next steps are clear and simple. Choose a schedule for this task. When the schedule is set, the program launch window will appear. Click Further. In a new window, click Review

In the window that opens, find the field File name and enter cleanmgr.exe and click Open.

The last step in creating a task.

All. Now you can view the properties of the task. Change the schedule, enable or delete a task.

This completes the creation of a schedule for running Disk Cleanup.

Utility cleanmgr.exe is a standard software (software) of operating systems of the Windows family and is designed to clean disks from unnecessary files in order to increase free disk space. It can be launched through the main menu - "Programs" - "Accessories" - "Utilities" - "Disk Cleanup", through the context menu of the disk properties, or in the command line (dialog "Run"). If no parameters are specified on the command line, the utility switches to interactive mode, waiting for user action.

For help using CLEANMGR, run the command:

cleanmgr /? or cleanmgr /usage

The help contains the bare minimum level of information, without any examples:

To get the most out of Disk Cleanup, the utility must be run in the context of an administrator account.

Command line options:

Sageset:n- setting a set of disk cleanup options with an identifier n to further perform this disk cleanup option using the Sagerun:n.

. Sagerun:n- performing disk cleanup with a pre-prepared setting specified by the value of the identifier n.

/Tuneup:n- this parameter is similar to the parameter Sageset:n.

/LowDisk- The utility displays a Disk Cleanup window with checkboxes for all possible cleanup options. If you run as administrator, then the ”Clear system files” button is not displayed and not only user data is cleared, but also system data, without any additional actions, after clicking the ”Ok” button.

/VeryLowDisk- similar to the /LowDisk switch, but disk cleaning is performed immediately, without any dialogue with the user. .

/setup- used to clean the disk from the data of the previous Windows, saved when reinstalling or updating the system. If you, for example, upgraded your Windows 8.1 to Windows 10 or reinstalled the system with saving user data, then the cleanmgr.exe /SETUP command will remove all files of the previous system and data from the directories used for installation - C:\Windows.old, C :\$Windows.~BT, C:\$Windows.~LS, $Windows.~WS, C:\ESD\Download, C:\$INPLACE.~TR. The /SETUP purge command must be run with elevated privileges. Program execution results are saved in log files setupact.log and setuperr.log catalog C:\Windows\System32\LogFiles\setupcln. Instead of a parameter /setup can be used /Auto clean.

/D drive letter- perform cleanup for the specified drive. If the parameter is not set, then the disk is selected manually.

Disk Cleanup settings are stored in the registry key
HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches

Examples of using.

cleanmgr /sageset:1- create a set of disk cleanup options with ID 1.

cleanmgr /sagerun:1- perform disk cleanup with the set of parameters specified by identifier 1.

cleanmgr /verylowdisk- perform the maximum cleaning of the system disk without dialogue with the user.

cleanmgr /dD:- clean up disk D:

When running Disk Cleanup with administrator rights, it is possible to delete all shadow copies of a volume except for the last one, which allows you to significantly increase the amount of free disk space. Why go to the "Advanced" tab

In Windows 7 and later, shadow copy data not only contains system restore points, but also represents an almost complete copy (snapshot) of the entire disk. These copies are stored in a specific format in the system folder System Volume Information, and are base snapshot files and subsequent snapshot files reflecting file system changes relative to the base snapshot. Shadow copies are created periodically by a special task of the scheduler, or when programs are installed or removed. There can be from several to two dozen such copies, depending on the size of the part of the disk space allocated for system protection, and each of them can be a snapshot file ranging from several hundred megabytes to several gigabytes in size. Therefore, it is the cleanup mode with additional removal of shadow copies that gives the maximum increase in free disk space.

To work with volume shadow copies, you can use the command line utility VSSADMIN

When working with a computer, a certain number of unnecessary files gradually accumulate on the disks. Many programs create temporary files, but not all delete them when they're done. Of course, only you can tell about most files whether they are needed or not, however, during its work, the Windows system itself creates many files that take up disk space for nothing. Program Disk Cleanup(Disk Cleanup), also belonging to the group of utilities, is used to remove unnecessary files from the disk. Disk Cleanup can be started either automatically or manually. Automatic start occurs when there is less free space on the disk than the limit set in the system. In this case, a dialog appears warning about this (Fig. 9.3). Please note that the less free space remains on the disk, the more often this dialog will appear.

Figure 9.3.

To start a disk cleanup where there is little space left, click the button Disk Cleanup(Disk Cleanup) of this dialog. If you want to run the cleaning program yourself, then open the folder My computer(My Computer) in the Windows main menu. Right-click on the icon representing the disk you want to clean up, and select the command from the secondary menu Properties(Options). In the dialog that appears, click on the icon General(General) to select the desired tab. On this tab, click the button Disk Cleanup(Disk Cleanup) to launch the corresponding program. The cleanup program searches the specified drive for files that can be deleted automatically. At the end of the disc scan, a dialog appears on the screen showing the results of this scan (Fig. 9.4). The list in the center of the dialog shows the groups of files that can be deleted and the disk space they occupy.

Figure 9.4.

While Windows is running, a lot of files are generated on the disk that are created for temporary purposes. When there is plenty of disk space, the number of these files doesn't really matter. When disk space runs out, deleting extra files can help solve the problem. When viewing a disc, several groups of files are considered to be deleted. First of all, this is the contents of the folder Basket(Recycle Bin), which contains the files you delete, since most of the files that fall into it are intended for final destruction. Next comes the folder Temporary Internet Files(Temporary Internet files) containing files that appeared on the computer while using the Internet. These files are needed for quickly revisiting Web pages that you have already visited, and nothing bad will happen if you delete them.

Many programs during their work create temporary files to store some parts of the information being processed. Windows provides a special folder for these files. Sometimes these files are not destroyed when the programs that used them end. To delete such files, a special group is provided. Several other groups of files are also offered for cleaning. To specify the deletion of groups of files, select the appropriate checkboxes in the dialog. When you click the OK button of the dialog, the cleanup process will begin. When asked if you really want to delete the files, you should answer in the affirmative by clicking the Yes button in the dialog that opens. A dialog will appear with a progress indicator that illustrates the cleaning process (Fig. 9.5).

Figure 9.5.

Sometimes deleting unnecessary files does not solve the problem of lack of disk space. In this case, the system may 1 prompt you to uninstall some Windows components or installed programs. You can do the same yourself if you select the tab Additionally(More Options) dialog Disk Cleanup(Disk Cleanup) (Fig. 9.6).

Figure 9.6.

On this tab, you are offered three options to increase free disk space by deleting some of the files used by Windows. The first group of controls allows you to remove some Windows features that you are not currently using. To remove part of the Windows feature, click the button Clear(Clean up). The first dialog of the Windows Components Wizard appears. This dialog contains system components that you can remove as a list. Selecting a list item displays a comment at the bottom of the dialog about what the selected component is, and also displays the amount of disk space occupied by this component. To mark a component for deletion, check the box next to the corresponding list item. The second group allows you to remove previously installed programs. Button press Clear(Clean up) in this group of controls will result in a dialog Add/Remove Programs(Add/Remove Programs. This dialog also lists currently installed programs. After selecting a program to remove, you will see the amount of disk space it occupies. To remove a program, click the button Delete(Delete). The Uninstall Wizard will launch. You can read more about installing and removing Windows components, as well as removing installed programs, in the corresponding chapter of this book.

CATEGORIES

POPULAR ARTICLES

2022 "minomin.ru" - A site about computers and working on the Internet