Scott Hanselman

Guide to Freeing up Disk Space under Windows 8.1

June 09, 2014 Comment on this post [31] Posted in
Sponsored By

This is an "updated for Windows 8.1" version of my popular original article Guide to Freeing up Disk Space under Windows 7.

I've got a 256 gig C: drive that is an SSD, but things add up and I've noticed that in the last week or so I've only got about 20 gigs free and it was feeling cramped. A few hours later, I have 80G free. Here's how.

Warranty: There is none. Please read carefully and with all things you find on a random blog, be careful because you have no one to blame but yourself. However, if you take a few minutes, read carefully and do even a few of these tips or just run Disk Cleanup, you'll get lots of space back.

  • Press Windows Key + W and type "Free up." You'll see a few options. We're going to run two things.
    • First "Free up disk space on this PC" which runs full screen as a "modern app."
    • From here you can see how much space your Windows Store apps take up, as well as pictures, Videos, etc. You can also empty your recycle bin from here. It'll also give you a decent idea of how your personal files take up space.
      image
    • If you click "See my app sizes" you'll go to this screen where you can quickly uninstall apps. I don't bother with anything under 100 megs.
      image
  • Now, run "Free up disk space by deleting unnecessary files" which is the Disk Cleanup desktop app.
    • This app is your main line of defense and lists all kinds of things it can clean up. Be sure to click the "Clean up system files" option to run Disk Cleanup as Administrator. This will allow it to find and identify a lot more files for cleanup.
    • image
    • When you run Disk Cleanup as admin, as I have below, it is able to cleanup after Windows Update files. Note the difference between the screenshot above (run normally) and the one below (after clicking "Cleanup System files." It's found 238 megs of files from Windows Update that aren't needed. You may find lots more.
      image
  • Set your Windows Store Mail app to only download a month of mail. See how mail above uses 514 megs of space? That's because I told it to download all my mail. From within the Windows 8.1 mail application, press Ctrl-C, then click Settings, then go to Accounts and under Options for your account change the "Download Email from..." option to the last month, or even less.
  • Disable Hibernate - I have a desktop, and I prefer just three power states, sleeping, on or off. I don't use Hibernate. Plus, I have 12 gigs of RAM, and hibernation uses as much disk space as you have RAM. From an administrative command prompt, type "powercfg -h off" to get that space back. Got me back 12 gigs. It's up to you. Don't turn it off if you use the feature.
  • Virtual Memory - If you've got 8 or more gigs of RAM, it's likely that Windows has allocated more Virtual Memory as a file on disk than needed. It's not bad, and it's not a bug, it's just conservative. For example, I have 12 gigs of RAM and Windows has allocated a 12 gig "swap file." Interestingly, it's recommending (not sure if that's to me, or to itself) that I have only 5 gigs. Boom, change it manually and I get 7 gigs free. Not a big deal with a 500 gig drive, but a HUGE deal on a 128 gig SSD.
    Type Windows Key+W, then "Advanced System Settings" and enter. From here, go to Performance Settings, then Advanced. Under Virtual Memory, click Change. This is usually managed for you. Change it only if you feel you know what you're doing. Here I've moved it to my D: drive, opening up space for my smaller C: drive.
    image
  • %TEMP% Files - Even though Disk Cleanup is great, sometimes for whatever reason it doesn't always get stuff out of the TEMP folder. I recommend you try to delete the TEMP folder. I do this from the command line. Open up an administrative console, type "cd /d %TEMP%" (without the quotes, of course). Then, go up one folder with "cd .." and type "rd /s temp"
    Do be warned, this command says to TRY to delete the whole folder and everything underneath it. It's very unambiguous. If you don't feel comfortable, don't do it. If you feel in over your head, don't do it. If it screws up your computer, don't email me. Next, I do a "dir temp" to see if the folder really got deleted. It usually doesn't because almost always some other program has a temp file open and the command can't get remove everything. If it DOES remove the folder, just "md temp" to get it back fresh and empty. This got me back 12 gigs. I'm sure you'll be surprised and get lots back.
  • imageDelete your Browser Cache - Whether you use Chrome, IE or Firefox, your browser is saving probably a gig or more of temporary files. Consider clearing it out manually (or use the CCleaner mentioned below) occasionally or move the cache from your browser's settings to another drive with more space.
  • Clean up System Restore - Windows keeps backups of lots of system files every time something major (driver installation, some software installations, etc) happens, and after a while this can take up lots of space. It uses a service/subsystem called ShadowCopies and can be administered with a tool called vssadmin.
    Now, the EASIEST way to handle this is just to run Disk Cleanup, then click More Options and "Clean up…" which will delete all but the most recent System Restore data. That's what I did. That got me back lots of space back on my C: drive.
    You can also go to System Properties, then System Protection, then Configure and not only control how much space to allow for System Protection but also delete preview restore points as seen in the screenshot at left.
    Alternatively, you can use the vssadmin tool from an admin command prompt to to do important things. One, you can set a max size for the System Restore to get. Two, you can set an alternative drive. For example, you could have the D: drive be responsible for System Restore for the C: drive.
    You can use the commands like this. Note that you can put whatever drive letters you have in there. I ran it for each of my three drives. Note that this isn't just used for System Restore, it's also used for the "Previous Versions" feature of Windows that keeps some number of Shadow Backups in case you delete something and didn't mean it. Kind of a mini, local time machine. Point is, this isn't a feature you probably want off, just one you want kept to a max.
    Here's the command line I used. Your mileage may vary.
    vssadmin Resize ShadowStorage /On=C: /For=C: /MaxSize=15GB
  • SpaceSniffer 1.1.0.0 - www.uderzo.it Understand what's taking up all that space with SpaceSniffer or WinDirStat or TreeSize Free.  - I've used a large number of Windows Folder Size checkers, and the one I keep coming back to is WinDirStat. WinDirStat is oldish but is Open Source, and it works great in Windows. It's wonderfully multi-threaded and is generally fabulous. It'll help you find those crazy large log files you've forgotten about deep in %APPDATA%. It saved me 10 gigs of random goo. SpaceSniffer is also amazing and really lets you drill into what's going on space-wise in your disk.
  • Remove Old Stuff - Just go into Add/Remove Programs or Programs and Features and tidy up. There's likely a pile of old crap in there that's taking up space. I removed some Games and Game Demos and got back 5 gigs.
    Be sure to SORT by size to find big stuff AND sort by "installed on" to find old stuff you've forgotten! Also note the "Total size" at the bottom that no one notices. This is the total size of Desktop apps, not Windows Store apps.
    image
  • Uninstall anything evil - If you want to get a quick look at what's on a machine and uninstall LOTS of stuff quickly, look no further than NirSoft's My Uninstaller (download). Remove Toolbars (they think they need them and they never do and won't miss them), and anything that looks like it might destabilize their system. I check out toolbars, add-ins, etc
  • Wasteful TempFiles/ScratchFiles Settings in Popular Programs - Most programs that need scratch space have a way to set a ceiling on that Max Space. Go into Internet Explorer or Firefox, into the options and delete the Temporary Internet Files. Set a reasonable size like 250 megs or 500 megs. I've seen those cache sizes set to gigs. If you've got a speedy connection to the internet, that's just overkill. Check other programs like Adobe Photoshop and other editors and see where they store their temporary files and how large they've become. I used SpaceSniffer (mentioned above) and was shocked to find 5 gigs of old temp files from a year ago in little used programs.
  • Podcast Apps, especially iTunes - If you've configured iTunes to automatically download podcasts, be aware that these can app up if you use the default settings. Set your podcasts to keep only the last episode or last few, rather than 10 or more unlistened-to files.
  • A nicely compressed directoryNTFS Compression - That's right, baby, Stacker (kidding). This is a great feature of NTFS that more people should use. If you've got a bunch of folders with old crap in them, but you don't want to delete them, compress. If you've got a folder that fills up with text files or other easily compressed and frequently access stuff, compress 'em. I typically compress any and all folders that are infrequently accessed, but I'm not ready to toss. That is about 30-40% of my hard drive. Why bother to compress when Disk Space is so cheap? Well, C: drive space usually isn't. I've got an SSD, and it's small. I'd like to get as much out of it as I can without the hassle of moving my Program Files to D:. More importantly, Why the heck not? Why shouldn't I compress? It's utterly painless. Just right click a folder, hit Properties, then Advanced, then Compress. Then forget about it. As long as you're not compressing a bunch of ZIP files (won't do much) then you're all set. You might consider defragging when you're done, just to tidy up if you don't have an SSD.
  • Find Fat Temp File Apps and squash them - Google Earth and Microsoft Virtual Earth 3D are really fast and loose with the disk space. You can poke around for a while and next thing you know you're down 2 gigs or more. If you don't use the app a lot, delete the caches when you exit, or better yet, make the cache size for each app small.
  • Remove Crap with CrapCleaner (CLeaner) - This is a brilliant utility that removes crapware, unneeded programs, toolbars and other things that might litter up your machine.
  • works-on-my-machine-starburst ADVANCED: Use Junction Points/Hard Links/Reparse Points to move temp file folders - This is an advanced technique. If this technique kills your beloved pet cat, don't email me. You have been warned. Also, note that I'm only saying it works for me.
    I reclaimed 25 gigs just today by moving the MobileSync Backup folder from iTunes to a spinning rust disk off my SSD.
    Here's the idea. You'll move it to a drive with more space, but you'll LIE to iTunes using a little-used Windows Utility that will make a LINK between the folder iTunes expects to find and the folder you want your backups in. See? It's advanced but VERY powerful, especially when you
    C:\Users\Scott\AppData\Roaming\Apple Computer\MobileSync>dir

    Directory of C:\Users\Scott\AppData\Roaming\Apple Computer\MobileSync

    11/25/2011 10:10 PM <DIR> .
    11/25/2011 10:10 PM <DIR> ..
    11/25/2011 10:10 PM <JUNCTION> Backup [f:\iTunesMobileSync\Backup]
    0 File(s) 0 bytes
    3 Dir(s) 97,594,851,328 bytes free

While your are in there, why not do some more maintenance on your machine, blow out that dust and install some updates? Check out the The Technical Friend's Essential Maintenance Checklist for Non-Technical Friend's Windows Computer.

Hope this helps! If I missed anything, sound off in the comments!


Sponsor: Big thanks to Mindscape for joining us and sponsoring the blog feed this week! I discovered Raygun.io and started using it for my side project and I LOVE it. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
June 09, 2014 9:27
I strongly suggest you Space Monger to you, and anyone! It's amazing to spot unforgotten download folders, or folders with very big sizes. For example my C:\Windows\Installer folder got really big, I mklink'd it to my F: drive, because my C: is SSD and I need space!
Screenshot: http://www.snapfiles.com/screenfiles/spacemonger.gif
Software: http://www.sixty-five.cc/download/
June 09, 2014 9:32
My comment looked like I'm marketing it. I don't have any relations to the neither software nor the developer, but I love using it. :)
June 09, 2014 9:47
I think the biggest waste is folder C:\Windows\Installer\$PatchCache$. I know there are important setup binaries there. But Windows should provide some way to purge those nearly never-used-again files. "Disk Cleanup" just didn't do that. It found only few megabytes to cleanup while the Installer folder took a lot more than ten gigabytes.
June 09, 2014 10:59
@Panya

As I've said, you can mklink that folder to another disk. I did that, no issues still.
June 09, 2014 11:03
Thanks Scott, I saw this post on feedly using my phone and after going through each step (except the email one) my 128gb ssd turned blue again instead of being red. It is strange how the red bar showing 10gb bothers us so much and yet we lived so many years with a lot less space. WHo ever thought we would start bitching about how many gigs we had left!

That said, when I press ctrl+c in the email app nothing happens. Wait, I recall something about the rightmost edge to find settings. Let me try that and get back to you.
June 09, 2014 11:06
Finding the bottom right corner is tough when you run a multi-monitor setup. That is why you recommend ctrl+c. Changed the setting and apparently setting two weeks (I have two smartphones so if I haven't read the email in two weeks I might be dead) on one of four email accounts sets all of them.
June 09, 2014 11:16
James - WindowsKey + C
June 09, 2014 11:26
Right. The charms key combo. I live in denial of all things windows 8. I once had my mouse and trackpad freeze. It was a awkward 2mins as I figured out how to restart without a mouse or pointing device.
After that I recalled that the shutdown is in the top righthand corner and I don't need to rightclick the bottom lefthand corner.
June 09, 2014 11:30
Thanks, Scott, very interesting and useful.
The link to http://www.piriform.com/ccleaner seems to be badly formatted.
June 09, 2014 12:51
Do we still miss ability to deal with winsxs? I understand it is not supposed to be touched at all, but I highly doubt we indeed need all stuff it contains.
June 09, 2014 13:51
This is great advice. As always with nitpickers I have some comments:

1. WinDirStat is not multithreaded. See Help.chm under FAQ. It is so good that it does not even need multiple threads ;-).

"Does WinDirStat start threads for the read jobs?
No. WinDirStat is - apart from the about box, which runs in an own thread, and apart from the drive querying in the drive selection dialog - single-threaded. All work is done in OnIdle()."

2. When you make your page file smaller than you physical Memory you will not be able to create full crash dumps anymore (http://support.microsoft.com/kb/130536/en-us). Kernel dumps will still work if you have a page file which is about one-third the size of the physical memory.

I have used Directory hard links for Program Files Folders as well without issues. Patching and related stuff with MSI continued to work. This can really help if you want to move your beloved but disc space hungry game to a different drive.
In my experience the most space consumuning important applications were games ;-).
June 09, 2014 17:52
Good to see you've covered every option available.
However, in my experience the "Windows Update Cleanup" almost always fails. And trust me it is more than a few machines or installations of Win 8/8.1
The cleanup process gets stuck whether done via disk cleanup or via command line i.e. Deployment Image Service Management's /Cleanup-Image and supporting switches.
So I'd caution anyone and everyone who doesn't know what it does, to stay away from it. :-)
June 09, 2014 18:27
I bypassed some of this by using an unattend.xml file during my Windows 7 installation to move the Users directory to my HD, leaving my 512 GB SSD with even more space. I haven't had any issues with it, but I heard that it causes problems when updating on Windows 8.
June 09, 2014 18:50
Also check your windows search DB. There was an issue with Windows 8 - my search DB grew to > 70GB - http://support.microsoft.com/kb/2838018/en-us
June 09, 2014 18:53
Isn't moving your swap file from the SSD to the spinning rust going impact performance if you get to the point of using the swap file? Wasn't that the idea behind ReadyBoost?
June 09, 2014 19:07
Got error when try

vssadmin Resize ShadowStorage /On=D: /For=C: /MaxSize=15GB

Error: The specified volume shadow copy storage association was not found.
Any suggestion

I am shocked how much I can free up.
Many thanks for your great tips.
June 09, 2014 19:21
I've found that running WinDirStat as Administrator is helpful to fully root out where space is being consumed, especially if there are multiple user accounts on the system.
June 09, 2014 19:22
Using OneNote? syncing your notebooks through OneDrive? Do you really need TWO local backups? I got gigabytes of space back by setting this to just one local backup (one of the few space savers you can do on RT). Change it in options inside OneNote. To make sure I get the space back at once, I move the backup to a different folder (in the same Office folder tree), and delete the original backup - MAKE SURE YOUR SYNC IS UP TO DATE BEFORE YOU DO THAT. Saved several gigagbytes on all my PCs with this ;)
June 09, 2014 19:23
For business environments, try FolderSizes - a very powerful disk space analysis and reporting tool with many advanced enterprise features (snapshots, scheduling, email integration, and much more).

http://www.foldersizes.com
June 09, 2014 19:43
maybe in some distant future, those legacy windows dialogues will finally be ported to not look like straight out of the 90s ;)
June 09, 2014 20:59
It's a shame that moving your AppData\Local folder from the default location breaks "modern" apps. I've got nearly 6Gb of crap in that folder that I can't move from my 120Gb SSD to my 2Tb SATA without breaking large parts of Windows. Even a junction point doesn't do the trick.
June 09, 2014 23:55
FYI, on a UK English localised (with an 's' :)) version of Windows 8.1, two of the items are named "Clear disk space on this PC" and "Clear disk space by deleting unnecessary files" rather than being "Free up".
June 10, 2014 5:44
Did I miss something? Put large files in the local OneDrive folder and mark as "Online Only".
June 10, 2014 8:54
Too much effort. This waste of time stuff needs to be simplified so my non-technical family members can do it too.
June 10, 2014 15:21
@Richard
"It's a shame that moving your AppData\Local folder from the default location breaks "modern" apps."

Could not agree more, and while I am a very satisfied professional user of 8.1u1, this stands as one of the 4 stupid design issues in Windows 8 / 8.1 :

1) forced "Microsoft account" login to be able to use OneDrive. From a privacy standpoint, this is criminal, and it is aggravated by the blatant "force my hand" moves such as invalidating microsoft apps individual loggings every few months. I do NOT use it even on my wife's surface pro. I want control over my credentials, not marketing's blatant ploy to inflate "social account" numbers.

2) The cretinization of network control, it's plain unworkable in any environment without an AD server. Removing the capacity to manually change an ad-hoc network to "private" ? : stoopid (I do it with PowerShell, but it's a pain, ans it must be done at each reboot). Forcing internal Hyper-V network to "public" no matter what ? A pain. Network neighborhood integration ? at best Russian roulette (works whenever it wants, and my home network is ALL windows 8.1u1 (nothing fancy), all my computer have local accounts with the same passwords, it used to work, it's broken since they tried to simplify networking (did not even work that well with Windows 7 + XP, but at least it was somewhat stable, since Windows 8 it's crap, each share access randomly works or not, i have to fairly often resort to using "net use" to access a share).
Build something designed so any idiot can use, you will get something only an idiot will use.

3) the split between "old control panel" / "new setup", both incomplete. What a pain.

4) The general inability to handle multi disk installations of windows (@Richard's problem). this is a pain for developers. Not a new problem, it has never really been supported, but this has gotten a *lot* worse with windows 8.


June 10, 2014 16:47
In my quest for freeing disk space...

I once forgot I had enabled fuslogvw and because of this it kept on logging on my small ssd disk's systemprofile.

And the more I deleted the more space I lost. So I thought it was malware.

But it wasn't: systemprofile keeps on growing in size

So remember to disable logging !
June 11, 2014 10:22
A word of caution: there is a bug persistent since Windows 8.0 RTM where running Disk Cleanup makes changes to your Modern Apps settings.

Examples of changes that may occur:

Skype and several other applications no longer have permission to use Camera and Microphone.

Various applications are no longer allowed to use Location.

Alarms is removed from the lock screen.

File save location reverts from local disk to OneDrive.
June 11, 2014 13:33
Scott this is some good advice HOWEVER I came across an issue I did want to flag.

Whilst it should be perfectly safe to do what you describe here (I have done this many times before to save space on my SSD).

Directly after installing windows 8.1 update and then running the system clean up tool with system files removal I now (directly after doing this) get constant failures to run windows update with code 0x8024022. I also now experience failures with dism when using the /restorehealth switch.

Currently these issues are unresolved. I have already posted to the windows community forums about this and am awaiting a response there but I wanted to flag this to people as its not great, especially when the online restore of the componentstore fails :(
June 12, 2014 18:24
@Alex WinSXS is filled with hard links to files on the system for restore etc. The problem actually lies in Explorer's inability to properly report the size this folder takes up on disk.

Full details on technet - http://technet.microsoft.com/en-us/library/dn251566.aspx

June 14, 2014 1:13
Dude, no need to meticulously go through your files to find stuff you can delete. Just replace your 250GB SSD with a 500GB one, which nowadays costs less than 200$.
June 21, 2014 9:23
I have just one plea for all developers in the universe. If you create a temp file, please clean up your mess. My temp folder is not a public toilet, so please keep it clean.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.