[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More


Free Up Disk Space On Your C: Drive

Published on
41,087 Points
42 Endorsements
Last Modified:
Community Pick
1998: C++ - SQL Server 6.5
2000-2007: C++, VB6, C#, java - SQL Server 7.0-2005
2008-...: SQL Server 2005-2016
2014-2016: MVP Data Platform


Running out of space on the C: drive of your Windows XP machine and no budget for a new PC?  Then this article is for you!

Even though this article was written for Windows XP, I believe the tips should also be applicable to any other Windows version (as long as the files/folders mentioned further down actually exist).

Caution: Before you apply any of the tips mentioned in this article I'd like you to have a look at the disclaimer mentioned at the bottom of the article.

My Story

I've had the pleasure of seeing the following string in the Status Bar of my Explorer window while the focus was on the C: partition:

Disk free space: 0 bytes
This was after I got several error messages when logging on.  There was not enough space free to load my profile.  And that happened after I rebooted my machine because it had installed a batch of updates.

I was happy to see that even with all those errors, I could still get into Windows (XP SP3) – okay, it didn't load my background picture nor my favorite Explorer settings but who cares at that point – and free up some space.  After doing that I rebooted and logged on again using my profile, this time it did load successfully.

As you may tell, I have been having space issues for a while now.  Here are some tips that you can use if you want to free up space on the C: partition of a Windows XP installation.

Run Disk Cleanup

In case you're not familiar with this tool, have a look at this article at The Elder Geek, or this Microsoft KB article.

I run this occasionally, especially right before starting a defragmentation.  To defragment my drives I use MyDefrag which does it quite nicely btw.

Compress Folders

If your partition is formatted using NTFS, you have the option of compressing your folders.  This is an easy solution but usually it doesn't really give that much extra space.  Unless you are storing a lot of large text files on your C: partition.  Anyway, currently I have both my \Program Files\ and my \Documents and Settings\ folders compressed.

Beware though: SQL Server does not like its folders compressed.

Move Swap File

If you haven't done so already, an easy way to free up space is to move the pagefile.sys to another partition.  See the How to move the paging file in Windows XP KB article for more info.

My paging file is on the D: partition.

Reduce Space For System Restore

Here's an interesting article about how the System Restore functionality uses harddisk space.  Now you know why you see the balloons popping out of the System Tray when you're in a space race :-)

The fastest way that I can think of to change the space usage settings are: Windows Key + Break > System Restore tab > select drive > Settings button.

As I recently ran out of space on the C: partition, practically all my restore points are gone already.

Good information about the System Restore tool is available here on Tech Republic.  With that info you'll be able to decide how to adjust your settings.

Remove Backup Folders

Hotfix Uninstall Folders

When Windows updates are installed, for each hotfix there will be a backup folder.  You've probably already seen them.  Under C:\Windows there are some folders called $NtUninstallKB123456$, or similar.  You can even recognize the Knowledge Base number in the folder name.

These folders are only needed in case you want to uninstall a certain hotfix.  Until now I never needed to do this.  But still, to be safe, I keep the ones that have been installed recently, the last 3 months for instance.  The rest, I delete.

More info on these folders: http://windowsxp.mvps.org/Hotfix_backup.htm

Service Pack Uninstall Folders

Similar to the hotfix folders, backup folders are being created when installing a Windows XP Service Pack.  The folder that you may remove once you've decided that you will never want to uninstall your Service Packs is called $NtServicePackUninstall$.

Here's a good Microsoft KB article about

How to Remove Windows XP Service Pack 1 Folders.  Although it's aimed at SP1, it still applies if you've installed SP3.  I have deleted all folders that contained “$NtServicePackUninstall” in their name.

Another good read on this topic can be found on Tech Republic, where the writer covers a backup procedure in case you change your mind afterwards.

SQL Server Hotfix Backup Folders

Again similar to the Windows hotfix folders, hotfixes for SQL Server create uninstall folders as well.  The folders that you may find back on your machine (depending on what components you've got installed) are:


These folders are for SQL Server 2005 and depending on what hotfixes you have installed you may have several similar folders with different KB numbers (the xxxxxx stands for a number).

I couldn't find an article to support this chapter of my writing, but here's  a short discussion about it with a comment from a Microsoft representative.

I removed them all.  (Please do note that this is not on a production environment.)

Internet Explorer Update Backup Folders

Just like the uninstall folders mentioned earlier, patches for Internet Explorer are creating backups as well.  On my machine I could find the following two folders:


If you don't plan on uninstalling Internet Explorer 7/8, it should be safe to delete the content of these folders.  But I couldn't find an official statement to confirm this.  If you know of an article that covers this please do let me know!

Until now I have not yet deleted these myself.

Remove SQL Server Setup Log Files

When performing installation changes to your SQL Server installation, including upgrades, several log files are created.  These files are located under C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG for SQL Server 2005 and C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log for SQL Server 2008.

Check out the Books Online for info on how to view and how to read these setup log files.

If you're not in the middle of performing installation changes and all your previous changes were successful then it's safe to remove the content of this log folder.

More info on this folder related to security can be found in this MSSQLTips article.

Resize The Partition

If with all of the above you're still struggling for space, only one option (besides a full re-install) remains: resize the partition!

I wasn't aware of a free tool that could do this until one of my friends told me about EASEUS Partition Master.  If you need it professionally or you have a 64-bit machine, check out the Professional Edition.

With this tool I was able to first make my D: partition smaller and then increase the size of the C: partition.


And Windows XP ran happily ever after…

Have fun wiping out those files!


Disclaimer: I hope it's obvious for everyone that several of the manipulations mentioned above are not without any risk and should only be performed when you know what you're doing.  And not in a production environment.  And only when you're desperate (well, maybe not really but it helps) :-)

If, after this disclaimer, you still feel like giving me some praise, well, there's still that YES-button ;-)

Originally appeared at my blog: http://blog.hoegaerden.be/2009/08/19/free-up-space-on-your-c-partition 

Additional Resources
A really extensive list of files and folders that are safe to delete
LVL 50

Expert Comment

Great article!  I have voted Yes, above.

One thing that was not mentioned (probably because it's so obvious...):

If you have room on your D drive (or on any external drive), you can MOVE files (rather than delete them).  

For instance, I found a large directory of old photographs and scans buried in My Documents.   I moved them to a "general storage bin" on a different computer, thus freeing up a few precious GB of storage space on my C Drive.
LVL 38

Author Comment

Thanks for sharing that extra tip Dan!  It may indeed be obvious, but sometimes things are so obvious that people just don't think of them (as proven here :-)

So, good to mention that one!

Now that we've started, here's another one: have a look in your C:\Windows\ folder, it may contain quite a
LVL 38

Author Comment

(and then I hit that Enter button by accident and there doesn't seem to be an Edit option on a recently submitted comment...)

What I was saying: that C:\Windows\ folder may contain a lot of .LOG files.  These can all be deleted as well.  It probably won't give you hundreds of MBs but it's a small effort.

The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

LVL 50

Expert Comment

Another tip:
Use the search function to list all files larger than, say 1 MegaByte.   Show the list in detail view.  Then sort by size, largest on top.

Now you have a list of all of the really large files on the disk.  Sometimes you see old ZIP files or videos that you don't need.   But be careful!  The files are listed "out of context" -- don't just delete stuff you don't recognize :-)
LVL 18

Expert Comment

by:Ravi Agrawal
Good write up,

To put DanRollins idea, one step ahead, it is possible to relocate the entire "My documents" folder to a different partition altogether, Select My "documents", (in Windows Explorer, Desktop, or where ever your find it) right click for properties, In Target tab under Target Folder Location, browse to / Enter your Desired location and you are done. Windows also offers to move your current documents from current location to the new one.

Anyways, if you have hibernation enabled and you are running short of Disk Space, a good idea would be to "Disable Hibernate Feature" of Windows. If you have 1Gb of Ram that will free up 1Gb of Disk space enough to get you going for the cleanup. You cannot move hiberfil.sys to a different partition, so disabling hibernate is the only way to go.

If you are using Firefox or Opera or any other browser than IE, then clearing History would be a good idea too.

Lastly, if you use Outlook / Outlook Express "compacting" your mail folder or pst files would bring the disk space lower, too.

Just a few points that would touch up your Article.

Can't think of any other since you brought them under one roof already ;-)

Pushed up your Yes Vote count with one more vote.


LVL 38

Author Comment

Good points Ravi!

To build a bit further on the Outlook/OE compacting: the compact feature puts the original mail files into the Recycle Bin so don't forget to remove them from the Recycle Bin after the compact has finished.  Otherwise you'll have lost space instead of gained :-)


Expert Comment

I always move the outlook express databases and my documents away from the C partition, since the C partition is not meant (to me at least) to store personal data, only OS, applications and their settings. It's the best way to keep the free space on the C drive as constant as possible, and it's also a good way to avoid quick fragmentation of files on the C partition.
LVL 23

Expert Comment

by:Malli Boppe
First step I normally do when I need to free up space is run a tool called treesize(freeware) which tells the size by each folder.Really useful tool.
LVL 31

Expert Comment

by:Justin Owens
Great Article!  I would mention that JKDefrag has been updated and is now called MyDefrag.  It can be found at http://www.mydefrag.com/.


Expert Comment

Moving the swap file to its own partition is a good way to not only free space, but also possibly improve performance.  The biggest problem with fragmentation is that the swap file gets fragmented - and since this is often being accessed constantly, the system can't afford to have some of it suddenly disappear, hence Windows defrag won't touch it.  If you create a partition that is 2.2 times the size of your ram, you can then set the partition as the location of your swap file, with the maximum size being 2 times the size of your ram.  This is important - if you let the swap file fill the entire partition, you'll get Windows whinging at you that drive E (for the sake of an argument) is out of disk space.

I would also recommend ensuring that any data that gets changed constantly (log files, temporary files etc) gets put onto a separate volume, as these can contribute to the problem of fragmentation.  I haven't yet tried this, as it is quite involved, but it is something I would like to have a go at when I have more time.  Windows 2000 and above allow you to mount partitions as folders - you can set certain folders as partitions so you don't have to go digging through the registry to find where a certain special folder is to change it.

Just a few extra tips that may be useful to someone.
LVL 18

Expert Comment

by:Ravi Agrawal
>> Windows 2000 and above allow you to mount partitions as folders - you can set certain folders as partitions so you don't have to go digging through the registry to find where a certain special folder is to change it.

Interesting, but how? please enlighten.


Expert Comment

I liked the article.  However I am additionally curious about how or if it's even possible to move the recycle bin to a different drive altogether?  I am not referring to turning it OFF or setting to 0% which is essentially the same as OFF for a particular drive, but actually allowing it to capture and keep deleted items for let's say the C:\ but having the files stored on D:\ but still recoverable back to c:\.

Likewise how do you move the temporary files of a print server (spool & subs) to a different driver other than the defaulted system drive?  

I am thinking more along the lines of having all temporary and non-critical items which may change throughout the day onto a specified hard drive.  This way I do not need to be concerned about unnecessary block changes being replicated.
LVL 38

Author Comment

Hi kigit, thanks for your comment.  As for your questions, I have no idea.  You'll most likely get a better answer if you post them as an actual question instead of a comment on an article.


Expert Comment

Great tool called TempCleaner 3.0.4 to delete temp internet files/windows update temps/cookies etc, does a much better job than CC Cleaner.  Have used this on several machines that are not properly maintenanced and usually bogged down with 2-8 GB of nothing but temp files.

Expert Comment

For That You Can Delete Those Files And Use CCleaner Which Is A Free Tool from www.ccleaner.com

1st go to windows Directory and delete Help folder
2nd go to folder option > check on Show hidden file + show system file go to your windows Directory and you will find alot of hidden setup files and hot fix uninstaller .. also this step you can do with CCleaner .

open CCleaner and start cleaning + fix your registry  
LVL 14

Expert Comment

by:Dhiraj Mutha

You can also check for unwanted profiles laying in your C:\Documents & Settings. You can clear them up and you will find a drastic change in your system performance.

Also, you can clear up the files in C:\Windows\$*.*, this also will clear up the space from your C drive.

Expert Comment

Simply do a best step,  if you have more than two partitions on your harddrive
Go to Start -> Control Panel-> Click on System Icon
Look for Advance Tab and then Look for Performance Click on button Settings
Again Click on Advance -> Virtual Memory -> Click Change and select no paging on C: Drive,
and set the paging / Virutal Memory on D: Drive and select System Managed size and select Set
Restart the Windows XP and you are all done.

Expert Comment

All files can be deleted in these folders

C:\Documents and Settings\User name\Local Settingsl\Temp
*Note: Local settings is a hidden folder.  Don't forget to check all user accounts.


Also check to see if you have any extra temp files in your AV....  If you do... delete those too...

Expert Comment

I have used the Pagefile moving feature in Virtual Memory and I now do see pagefile.sys set up on my D: drive. Yet I still have a pagefile.sys file on my C:, do I attempt to delete it (i think that is not possible as it is using resources) or is there a step I have missed or screwed? Please advise and thanks in advance.
LVL 44

Expert Comment

by:EugeneZ Zhitomirsky
I would say -  properly preallocate C drive space (if XP C drive is too small - buy new one :) )
keep in mind where to you install software binaries (you can  use not just C drive...)
and I would recommend to be very cautious about removing C:\windows .. SQL Server Hotfix Backup Folders  
at least copy them to another Drive just in case..

e.g   sql server 2005 sp3 installation failed


Featured Post

Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Join & Write a Comment

Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Wrapper-1-Query. Use an Excel function to calculate a column for an Access query. Part 1. Shows a query in Access that has a calculated column with the results of an Excel worksheet function. See how to call a wrapper function from a query, and …

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month