Remove unnecessary files from a full hard drive

I have come across a lot of computers lately where the main OS hard drive (usually denoted as the C:\ drive) is full. Some clients have nicknamed this the “Red C” because when viewing the drive in Windows the C: drive usage bar is red. This can be caused for many reasons. The main reason being that people download a lot of data (movies, music and pictures) but don’t often clean up the unneeded data. A second reason for this is that to speed up aging computers people are moving towards SSD drives instead of the older technology of spindle drives. The issue here is that SSD drives tend to be more expensive for the same size so people buy smaller SSD drives. The last reason for this, that these commands help to remedy, is that Windows performs a significant amount of updates and doesn’t clean up from the update process very well.

When I come across a full operating system hard drive I run the following commands in command prompt to do a cleanup.

reg add “HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore\cfg” /v DiskPercent /t REG_DWORD /f /d 10

rd %systemdrive%\$RECYCLE.BIN /s /q

del C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\*.* C:\Windows\ServiceProfiles\LocalService\AppData\Local\Temp\*.* c:\windows\temp\*.* /s /f /q

The first command limits the amount of space designated to Windows restore. I believe that the default amount of space used by Windows is 15%. Since most people will never use Windows restore and don’t know what it is, 15% of the disk space is a lot to be set aside for this. The command will set the disk space set aside to 10%.

The second command essentially empties the recycling bin. However, this command does a better job as there are cases where your recycling bin may appear empty to you but still actually have files in it. This command completely removes the recycling bin directory which will then be recreated, completely empty, by Windows.

The last command is where most users will see the biggest gains in freeing hard drive space. This command will remove all temp files created by Windows. The most significant part of this is Windows update files that Windows will download for you to install updates but doesn’t actually remove the update file after the update is complete.

Notes:

  • Please use these commands at your own risk. However, I have used these on dozens of computers without any issues.
  • Microsoft recommends¬†that you keep a minimum of 15% of your hard drive free to run Windows properly.

To run these commands copy all 3 lines of the commands above. Open up command prompt in windows. Right-click in the command prompt windows and left-click paste. You may have to hit enter to execute the third command.

 

Remove unnecessary files from a full hard drive was last modified: May 2nd, 2017 by Mike Page
Posted in Builtbymike.ca, Computer Repair, Laptop Repair, Mikeonsite.ca, Onsite IT Service.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.