Disk space cleanup is a critical must these days with a lot of people opting for a Solid State Drive (SSD) in their computers. SSD drives speed up the computer significantly but the down side is that they tend to be smaller capacity drives, especially if you go for the cheaper options like this Kingston 120GB SSD for less than £20 (GBP) from Amazon.
So, you will want to save space where you can, so here we will show you how to use disk space cleanup methods. There are a few options available to you depending on your setup and what you are willing to use and not use.
Disk Space Cleanup Utility
Before we delve into the technical side of how to run the various elements of what a disk space cleanup takes, we would like to let you know about our free, simple to use tool that carries out all the below options automatically with just one double click!
Our Disk Space Cleanup Utility is basically a Windows batch file that runs through all the commands that are listed below. This means that you can download it, run the .bat file as an administrator and sit back whilst it does the work.
Disk Space Cleanup Utility Video Demo
You can see the disk space saver utility in action by checking out of demo video below:
Full information and instructions on this utility can be here and you can download using the button below:
Hibernation
First of all you have the option of turning off the hibernation feature. This feature takes up a lot of disk space as it uses it to store the current activity of your working session. So, if you can do without that, you can turn it off and this will remove the large hiberfil.sys file from your disk and save you space.
To turn off hibernation, right click on your Windows 10 Start Button and select “Command Prompt (Admin)” to bring up a command prompt which has been elevated to an administrator level. Then type in the following command to disable the hibernation on your machine:
powercfg /h off
You will need to then reboot your machine to complete the removal of the hiberfil.sys file from your machine.
Pagefile
If you are using a desktop computer with a SSD as your primary but also have a larger capacity SATA hard drive as a secondary disk, then you can move the pagefile.sys from the root of your C: drive to the secondary larger capacity disk. The pagefile size is dependent on the amount of RAM you have in your machine, so the more RAM you have, the more space the pagefile.sys will take up on your disk.
So, to move the pagefile.sys, carry out the following steps:
Right click on your Windows 10 Start Button and select “System“. This will bring up a box and you will then need to click on “Advanced System Settings” on the left hand side:
This will take you directly into the “Advanced” tab and you should then click on the “Settings” button under Performance:
This will take you in to the “Performance Options” and you should then click on the “Advanced” tab and then click on the “Change” button under the “Virtual memory” section:
You will then see that the default setting is that the “Automatically manage paging file size for all drives” is ticked. You should now untick this box which will allow you to make changes.
Click on the drive that you want to move your pagefile.sys to and then click the “System managed size” radio button. Then click on the “Set” button. You should then click on the drive where your pagefile.sys was originally and click the “No paging file” radio button and click the “Set” button. So your virtual memory should now look something like this:
You should now reboot your machine for the changes to take affect.
Disk Space Cleanup
You can run the built in Disk Cleanup option in Windows 10 allowing you to clean up significant amount of space like temp files and cache internet files. To do this, left click your Windows 10 Start button and then type “Disk Cleanup“. You should see it appear in your Start Menu. Left click it to start the application.
To start with, you will see a wizard where you can select which drive you want to run disk cleanup on:
Make your selection from the drop down list and click the “OK” button.
This will now start the process of searching for files that it can cleanup from your machine. Once complete, you should see something like this:
However, instead of proceeding from here, you should now go ahead and click on the “Clean up system files” button. This will run the search again and bring back a large number of selections that you can clean up on your disk. This will take a little longer to run through it’s search.
Once this is complete, you can go through the “Files to delete” selection and then click the “OK” button. This will then run through all the files as requested and clean them up. You should notice an immediate difference in your available disk space.
Windows Update Cache
Once you have tried all the above methods, you should have a significant amount of space now available. However, if you still need to free up more space. There are some more advanced options available to you.
One of them is to completely clear your Windows Updates Cache and database. Although not recommended, if you are desperate, you can go ahead and try this.
First of all, you need to stop the Windows Update service from running to allow you to make changes to the core files. So, go ahead and open up an elevated command prompt. To do this, right click on the Windows 10 Start button and select “Command Prompt (admin)“. In the command prompt window type the following command to stop the Windows Update service:
net stop "windows update"
This will stop the Windows Update service and you should get an output like this:
If you get a message stating that the service is not running, that’s fine and you can carry on to the next step.
You should now browse to the following location which is where the Windows Updates Cache is stored:
C:\Windows\SoftwareDistribution\Download
You can go ahead and delete all of the folders and files in this location.
You should then go to this location which is where the Windows Update database is stored:
C:\Windows\SoftwareDistribution\DataStore
You should go ahead and delete all folders and files in this location.
Once this has completed, reboot your machine and the Windows Update service will go back into the state it wants to run in. Next time you run Windows Updates, it will recreate a smaller database and then start to store files for the available updates from that point. So you can run through this process again later if you start to get low on space again.
WinSXS
The WinSXS folder can get extremely large. It is also a very important folder for Windows and other programs to work with future updates or uninstalls. In a simple way of looking at it, it is the source files for everything you install on your machine including software, drivers and updates. However, you can clean it up using the built in DISM program with Windows 10.
Note that this process really should be your last resort so do not blame us if you screw your machine up!
So, you really are desperate for some more free space if you have gotten this far in the guide so this is what you can do.
Open up an elevated command prompt. To do this, right click on the Windows 10 Start button and select “Command Prompt (admin)“. Then you can use these three commands to try and clean up any orphaned or unused files in your WinSXS folder:
AnalyzeComponentStore
Start with the /AnalyzeComponentStore parameter – this analyses the “store” of core files and is the important first step:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
Once this step has completed, it should show you some information on what disk space it has freed up:
Note that on my screenshot I only have one component that has been freed up as I have already run this command on my machine not long ago.
It would be interesting to see what results you get from running this command. Please feel free to leave us your results in our comments section at the end of this page!
StartComponentCleanup
Using the /StartComponentCleanup parameter deletes previous versions of updated components (without a 30 day grace period) and you will not have a 1-hour timeout limitation.
Dism.exe /online /Cleanup-Image /StartComponentCleanup
This will then go through and cleanup the components that it can. This will take a little longer than the other commands and may look like it gets stuck at 10% – but do not exit or close the command prompt, it will complete eventually and you will get a notice like this:
ResetBase
Using the /ResetBase switch with the /StartComponentCleanup parameter of DISM.exe removes all superseded versions of every component in the component store.
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
This should not take more than a few seconds to complete and you will see a completion notice like this:
SPSuperseded
To reduce the amount of space used by a Service Pack, use the /SPSuperseded parameter of Dism.exe to remove any backup components needed for uninstallation of the service pack.
Dism.exe /online /Cleanup-Image /SPSuperseded
In most cases, this command will not actually do anything as most installations will not have Service Pack installation files hanging around, but always best to run it just in case.
If there are Service Packs to cleanup, these processes can take a long time to run, depending on the spec of your machine, it could run into hours.
Comments
Hopefully this guide has helped you in clearing some disk space on your machine and if it has we would love to hear your feedback so please do leave us a comment below.