Geeks in Phoenix

Geek Blog


Clean up Windows 10 with Disk Cleanup

There are a lot of programs out there that can clean up your Windows 10 computer. But did you know that one of the best ones actually comes with Windows 10? Here's how to clean up your Windows 10 computer with Disk Cleanup.

<Clean up Windows 10 with Disk Cleanup

Disk Cleanup has been included with Windows since Windows XP and is part of my regular scheduled maintenance. Disk Cleanup can be run two (2) different ways and can have three (3) different sets of options. The first way to run it is from any of the embedded shortcuts in Windows (Start menu or disk properties). When using an embedded shortcut, you will have two (2) different sets of options, user and system.

Disk Cleanup user options in Windows 10
Disk Cleanup user options in Windows 10
Disk Cleanup system options in Windows 10
Disk Cleanup system options in Windows 10

When you run Disk Cleanup with user options, you can clean up user specific files such as downloaded program files, temporary Internet files and the recycle bin. With system options, you can also clean up Windows system files like Windows temporary files, device driver packages and previous installations of Windows, just to name a few.

Disk Cleanup command line options in Windows 10
Disk Cleanup command line options in Windows 10

Disk Cleanup can also be run using command line switches. When you do this, you get the maximum options available. But you will have to run it at an administrative command prompt to configure these options. These options include all of the user and system options plus a few more, like old chkdsk files, Windows Update Cleanup and Windows ESD installation files.

How to run Disk Cleanup from the Start menu

  1. Left-click on the Start button.
  2. Left-click on All apps.
  3. Scroll down to Windows Administrative Tools and left-click to expand.
  4. Left-click on Disk Cleanup. If you have more than one (1) drive, you will be prompted on which drive you want to clean up.

Disk Cleanup will scan your system for files that it can remove and will open with the user options available. You can now choose which user files you would like to delete. To activate the system options, you will need to select Clean up system files in the lower left hand corner. When you do this, Disk Cleanup will close and rescan your computer.

This time Disk Cleanup will now include system files that can be removed. It will also have a second tab on top called More Options. Under More Options you will find other options, Programs and Features and System Restore and Shadow Copies.

Programs and Features will take you to the Control Panel where you have the ability to uninstall programs or add / remove Windows features. Selecting System Restore and Shadow Copies will delete all but the most recent restore point. Use this carefully, as you cannot get back any restore points are they are deleted.

How to run Disk Cleanup from an administrative command prompt

You can run Disk Cleanup with or without command line switches. When you run Disk Cleanup without any switches, it opens with the system options selections. When you run it with switch /sageset:n, you will get even more options than the system settings.

First thing you will need to do is open an administrative command prompt.

How to open a Command Prompt with Administrator privileges in Windows 10

The type the following into the command prompt to run Disk Cleanup.

cleanmgr

Disk Cleanup can also be used with command line switches, further expanding on its features. And when used with the /sageset:n and /sagerun:n switches you can save multiple configurations that can be used in a shortcut or as a scheduled task.

cleanmgr /sageset:n cleanmgr /sagerun:n

Here's an explanation of the /sageset:n and /sagerun:n switches.

  • /sageset:n - This switch displays the Disk Cleanup settings dialog box and creates 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. The n value can be any integer value from 0 to 65535. To get all the available options when you are using the /sageset switch, you may need to specify the drive letter that contains the Windows installation.
  • /sagerun:n - This switch runs the specified tasks that are assigned to the n value by using the /sageset switch. All drives in the computer will be enumerated, and the selected profile will be run against each drive.

How to run Disk Cleanup as a Scheduled Task

First you will need to have created a preset configuration using the /sageset:n switch. Then open Task Scheduler and create a new task.

  1. Left-click on the Start button.
  2. Left-click on All apps.
  3. Scroll down to Windows Administrative Tools and left-click to expand.
  4. Left-click on Task Scheduler.
  5. In the right column labeled Actions, select Create Basic Task. The Create a Basic Task Wizard will appear.
  6. Give the task a name and description and then select Next.
  7. Select when you want it to run (trigger).
  8. When prompted for what task you want to perform, select Start a program then select Next.
  9. When prompted for a program / script to start, select Browse and navigate to C:\Windows\System32\ and select cleanmgr.exe.
  10. In the Add arguments section, type /sagerun:n and then select Next.
  11. The then select Finish and you're all set.

How to speed up the boot time of your computer

Does it seem like your computer takes forever to boot up? Waiting for your Windows based computer to boot can be quite frustrating. But there are a few things you can do. Here is how to speed up the boot time of your computer.

How to speed up the boot time of your computer

Check the drive for errors

If your computer has a Hard Disk Drive (HDD), this is the first thing you want to do. HDD's are notorious for not writing data back to the exact place where the data was read from. Little known fact, but Microsoft didn't invent the Disk Operating System (DOS). It actually bought Quick and Dirty Operating System (QDOS) in the early '80's and renamed it MS-DOS. If you have a Solid State Drive (SSD), you can bypass this step, as SSD's don't have moving parts.

Check for hardware issues first with the software provided by the manufacturer of your HDD. The Ultimate Boot CD (UBCD) has all of the major drive manufacturer's diagnostics software built-in, so this is always a good place to start.

Diagnose computer hardware issues with the Ultimate Boot CD

Then check for software issues with Windows built-in CHKDSK.

Check your hard disk for errors in Windows 7 / Windows Vista

Check your hard drive for errors in Windows 8

Uninstall any unwanted programs

This one is kind of a no-brainer. Allot of adware / junkware will load itself up at boot, causing an increase in boot time. It also takes away resources that could be used by programs you really want to run. First thing to do is to go the Control Panel > Programs > Programs and Features. Then go through the list of programs to see which ones can be uninstalled. Remember that you can change the way the programs are listed just by clicking on the column name. I like to see when a program was installed, because you can find allot of unwanted clutter installations that way.

Remove unwanted items from start up

MSCONFIG inside of Windows 8
MSCONFIG inside of Windows 8

You can temporarily disable programs and services that start up with Windows using MSCONFIG. MSCONFIG is a diagnostic tool built into Windows that allows you to troubleshoot boot issues. You can enable and disable various boot settings, including programs and services that start up with Windows. Just open an Administrator Command Prompt and type MSCONFIG.

How to open a Command Prompt with Administrator privileges in Windows Vista and Windows 7
How to open a Command Prompt with Administrator privileges in Windows 8

Once you have your system fine-tuned with MSCONFIG, you could just leave your system running in diagnostic mode by having MSCONFIG not displayed at start up. To be honest, that's one of the first things I check for on systems I work on. It just too easy to let it go. But if you really want to permanently remove the items you have disabled in MSCONFIG, here's how to do it.

The Everything tab inside of Autoruns
The Everything tab inside of Autoruns

  1. Download and extract the latest version of Autoruns from Microsoft.
  2. Open MSCONFIG and make note of each item you have disabled.
  3. On the General tab of MSCONFIG, select Normal startup, then left-click Apply and OK. When prompted, just close MSCONFIG and do not restart the computer. Yes, this will enable all of the items you have disabled, but we are going to delete them next.
  4. Open the folder where you saved Autoruns.exe, right-click on it and select Run as Administrator.
  5. Once it is done scanning, you just need to find the items you had disabled with MSCONFIG. Check the Services and the Logon tabs first. Remember that you can check the logon items for each user with the User pull-down menu. Once you find your items you can 1) disable it with the checkbox on the left or 2) you can right-click on it and select Delete.

Clean up the drive

It's time to clean up some of the clutter that just seems to pile up. Using Windows built-in Disk Cleanup tool (cleanmgr.exe) will quickly clean out all sorts of crap, like user temp files and temporary Internet files. If you want to go a little further with cleaning your drive, download a copy of CCleaner.

Free up more disk space with Windows 7 Disk Cleanup (same for Vista)
Clean up your hard drive in Windows 8 with Disk Cleanup
Clean up and optimize your computer for free with CCleaner

Defragment your HDD

This is another step that only pertains to HDD's, since SSD's don't get fragmented. If your HDD is fragmented, is takes it longer to find and load files. Optimizing the HDD structure will always you give a little more speed. You can use Windows built-in Optimize and Defragment drive tool or another disk utility like Defraggler from Piriform.

Using Disk Defragmenter in Windows Vista
Using Disk Defragmenter in Windows 7
Defragment and Optimize your hard drive in Windows 8
Perform advanced disk defragmentation with Defraggler from Piriform

If you really want to go the extra mile with optimizing your HDD, just remove the swap file before you defrag and restore it after you're done. And when you restore it, go ahead and use the following calculations.

Minimum pagefile size is one and a half (1.5) x the amount of memory. Maximum pagefile size is three (3) x the minimum pagefile size. Let's say you have 2 Gb (2,048 Mb) of memory. The minimum pagefile size would be 1.5 x 2,048 = 3,072 Mb and the maximum pagefile size would be 3 x 3,072 = 9,216 Mb.

Free up more disk space with Windows 7 Disk Cleanup

During the normal use of your computer, you will accumulate a number of unnecessary files (temporary setup / internet files, recycle bin, etc.). You can remove these files with the built-in Disk Cleanup (cleanmgr.exe) utility inside of Windows 7. And it can be run a couple of different ways and with different options.

Running Disk Cleanup (cleanmgr.exe) on demand

There are a couple of different ways to run Disk Cleanup on demand. The following procedure cleans up files associated with your user account. You can also use Disk Cleanup to clean up all the files on your computer.

Windows 7 Disk Cleanup dialog box with standard options
Windows 7 Disk Cleanup dialog box with standard options

  1. Click Start, and then type Disk Cleanup in the Start Search box.
    or
    Click Start, then All Programs, then Accessories, then System Tools, then Disk Cleanup
  2. In the Drives list, click the hard disk drive that you want to clean up, and then click OK
  3. In the Disk Cleanup dialog box, on the Disk Cleanup tab, select the check boxes for the file types that you want to delete, and then click OK
  4. In the message that appears, click Delete files

The More Options tab is available when you choose to clean files from all users on the computer. This tab includes two additional ways to free even more disk space:

Windows 7 Disk Cleanup dialog box with more options
Windows 7 Disk Cleanup dialog box with more options

  • Programs and Features. This option opens Programs and Features in Control Panel, where you can uninstall programs that you no longer use. The Size column in Programs and Features shows how much disk space each program uses.
  • System Restore and Shadow Copies. With this option, you can delete all but the most recent restore point on the disk.
    System Restore uses restore points to return your system files to an earlier point in time. If your computer is running normally, you can save disk space by deleting the earlier restore points.
    In some editions of Windows 7, restore points can include previous versions of files, known as shadow copies, and backup images created with Windows Complete PC Backup. These files and images will also be deleted.

Running Disk Cleanup (cleanmgr.exe) as a scheduled task

You can also run Disk Cleanup from a command prompt. This gives you a few more options, like predefined settings for running Disk Cleanup as scheduled task in Task Scheduler. First we need to bring up a command prompt.

Windows 7 Disk Cleanup dialog box with sageset options
Windows 7 Disk Cleanup dialog box with sageset options

  1. Click Start, and then type cmd in the Start Search box.
  2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
  3. If you are prompted by User Account Control, click Continue.

You can start the Disk Cleanup tool by running cleanmgr.exe. Disk Cleanup supports the following command-line switches:

  • cleanmgr /d driveletter: - This switch selects the drive that you want Disk Cleanup to clean. Note that the /d switch is not used with /sagerun:n.
  • cleanmgr /sageset:n - This switch displays the Disk Cleanup Settings dialog box and creates 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. The n value can be any integer value from 0 to 65535. To get all the available options when you are using the /sageset switch, you may need to specify the drive letter that contains the Windows installation.
  • cleanmgr /sagerun:n - This switch runs the specified tasks that are assigned to the n value by using the /sageset switch. All drives in the computer will be enumerated, and the selected profile will be run against each drive.

How to run Disk Cleanup (cleanmgr.exe) on demand and as a scheduled task inside of Windows 7.

Customer service is #1

Here at Geeks in Phoenix, we take pride in providing excellent customer service. From computer repair, virus removal and data recovery, we aim to give the highest quality of service.

Bring your computer to us and save

Our in-shop computer repair service  is based on the time we work on your computer, not the time it takes your computer to work!

Contact us

Geeks in Phoenix
4722 East Monte Vista Road
Phoenix, Arizona 85008
(602) 795-1111

Like Geeks in Phoenix on Facebook

Follow Geeks in Phoenix on Twitter

Watch Geeks in Phoenix on YouTube

Geeks in Phoenix is an IT consulting company specializing in all aspects of Computer Repair / PC Repair / Laptop Repair. Since 2008, our expert computer repair technicians have been providing outstanding Computer Repair, Virus Removal, Data Recovery, Photo Manipulation and Website Support.

Geeks in Phoenix have the best computer repair technicians providing computer repair and service in Phoenix, Paradise Valley, Scottsdale and Tempe Arizona. We offer In-Shop, On-Site and Remote (with stable Internet connection) computer repair service.

Copyright © 2019 Geeks in Phoenix LLC