Free Up Disk Space On Your C: Drive

AID: 2439
  • Status: Published

13650 points

  • ByValentinoV
  • TypeTips/Tricks
  • Posted on2010-02-10 at 13:49:08
Awards
  • Community Pick
  • Experts Exchange Approved

Introduction


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 JkDefrag 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:

  • SQL9_KBxxxxxx_ENU

  • SQLTools9_KBxxxxxx_ENU

  • RS9_KBxxxxxx_ENU

  • OLAP9_KBxxxxxx_ENU

  • DTS9_KBxxxxxx_ENU

  • NS9_KBxxxxxx_ENU


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:

  • ie7updates

  • ie8updates


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.

Conclusion


And Windows XP ran happily ever after…

Have fun wiping out those files!

Valentino.

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
Asked On
2010-02-10 at 13:49:08ID2439
Tags

cleanup

,

disk space

,

free up

,

windows

,

out of space

Topic

Windows XP Operating System

Views
14298

Comments

Expert Comment

by: DanRollins on 2010-02-10 at 16:59:28ID: 9507

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.

Author Comment

by: ValentinoV on 2010-02-10 at 22:59:42ID: 9520

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

Author Comment

by: ValentinoV on 2010-02-10 at 23:03:08ID: 9521

(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.

Valentino.

Expert Comment

by: DanRollins on 2010-02-11 at 10:46:47ID: 9547

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 :-)

Expert Comment

by: grtraders on 2010-02-13 at 04:40:31ID: 9610

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.

Ravi.

Ravi.

Author Comment

by: ValentinoV on 2010-02-13 at 12:00:38ID: 9620

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 :-)

Regards,
Valentino.

Expert Comment

by: Juamez on 2010-02-20 at 13:55:57ID: 9915

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.

Expert Comment

by: mboppe on 2010-02-21 at 21:39:08ID: 9932

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.

Expert Comment

by: DrUltima on 2010-03-15 at 06:46:42ID: 10735

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

Justin

Expert Comment

by: SCRLPB on 2010-03-22 at 20:14:52ID: 11512

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.

Expert Comment

by: grtraders on 2010-03-25 at 01:32:32ID: 11726

>> 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.

Ravi.

Expert Comment

by: kigit on 2010-04-22 at 12:15:54ID: 13705

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.

Author Comment

by: ValentinoV on 2010-04-24 at 02:02:36ID: 13740

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.

Regards,
Valentino.

Expert Comment

by: Forror on 2010-06-18 at 05:41:27ID: 15915

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

by: Evathios on 2010-08-16 at 01:44:51ID: 18219

Hello
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  

Expert Comment

by: pspglb on 2010-09-26 at 21:40:43ID: 19927

Hi,

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

by: bluepeach19 on 2010-10-17 at 09:06:58ID: 20583

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

by: duckhead on 2011-02-14 at 03:55:16ID: 23828

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.

C:\WINDOWS\SoftwareDistribution\Downloads

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

Expert Comment

by: santiherm on 2011-05-13 at 03:42:11ID: 27274

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.

Expert Comment

by: EugeneZ on 2012-01-21 at 09:46:03ID: 34676

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

http://blogs.msdn.com/b/sqlserverfaq/archive/2009/01/09/sql-server-2005-sp3-install-fails-with-error-1612-unable-to-install-windows-installer-msp-file.aspx

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Windows XP Experts

  1. nobus

    109,514

    Master

    0 points yesterday

    Profile
    Rank: Savant
  2. MASQUERAID

    86,680

    Master

    498 points yesterday

    Profile
    Rank: Genius
  3. flubbster

    83,880

    Master

    2,000 points yesterday

    Profile
    Rank: Genius
  4. thinkpads_user

    44,689

    1,500 points yesterday

    Profile
    Rank: Genius
  5. BillDL

    43,868

    0 points yesterday

    Profile
    Rank: Genius
  6. Run5k

    41,750

    0 points yesterday

    Profile
    Rank: Genius
  7. Darr247

    38,180

    0 points yesterday

    Profile
    Rank: Genius
  8. SSharma

    36,782

    0 points yesterday

    Profile
    Rank: Genius
  9. ve3ofa

    34,109

    0 points yesterday

    Profile
    Rank: Genius
  10. cwstad2

    32,527

    0 points yesterday

    Profile
    Rank: Guru
  11. motnahp00

    29,474

    3,000 points yesterday

    Profile
    Rank: Sage
  12. DTHConsulting

    28,336

    0 points yesterday

    Profile
    Rank: Guru
  13. Anuroopsundd

    26,827

    2,000 points yesterday

    Profile
    Rank: Sage
  14. hanccocka

    26,512

    0 points yesterday

    Profile
    Rank: Genius
  15. arnold

    26,147

    0 points yesterday

    Profile
    Rank: Genius
  16. KCTS

    25,512

    0 points yesterday

    Profile
    Rank: Genius
  17. l33tf0b

    22,780

    0 points yesterday

    Profile
    Rank: Wizard
  18. rindi

    22,108

    0 points yesterday

    Profile
    Rank: Savant
  19. dstewartjr

    21,650

    0 points yesterday

    Profile
    Rank: Genius
  20. Callandor

    21,288

    0 points yesterday

    Profile
    Rank: Genius
  21. DaveBaldwin

    21,060

    0 points yesterday

    Profile
    Rank: Genius
  22. leew

    20,982

    0 points yesterday

    Profile
    Rank: Savant
  23. garycase

    20,824

    0 points yesterday

    Profile
    Rank: Genius
  24. rpggamergirl

    20,432

    10 points yesterday

    Profile
    Rank: Genius
  25. jcimarron

    19,748

    0 points yesterday

    Profile
    Rank: Genius

Hall Of Fame