16

My PC is 5 years old and I have had a great history for failed updates. Regardless if I open my C: drive, I have bunch of folders with names which sound something like this:2d51a0107296557123f92939e121

I can not delete those and I they are occupying more and more space on my PC everyday and I am not sure how to get rid with those since when I try to delete them manually, system just does not let me do it and throws security exception on my face.

4
  • Why do you think those files have anything to do with Windows Update? Why are you trying to delete files you know nothing about? If that has been your practice, it is no wonder you have a history of failed updates.
    – kreemoweet
    May 12, 2012 at 22:21
  • 4
    @kreemoweet: actually, Windows updates do use folders like those, and they sometimes get left behind. They can be hard to delete, but they don't usually take up a huge amount of space. May 12, 2012 at 23:19
  • 1
    It's taking 11Gb on my PC. Remember mine is 5 years old with a huge history of failed updates.
    – Lost
    May 13, 2012 at 0:07
  • Typically, the same problem that stops you deleting these folders also prevents you from seeing how much disk space they are using. So now I'm wondering if there's some other issue here. May 13, 2012 at 0:10

4 Answers 4

13

This is how you can delete these folders.

I'm going to pretend that the name of the folder we want to delete is abc123; replace that with the actual folder name. You can save yourself a lot of typing by using the TAB key; when typing a command you can just enter the first two or three characters of the folder name and then press TAB. You need to press ENTER after typing each command. Double-check each command (and in particular make sure you haven't accidentally specified a folder you don't want deleted!) before pressing ENTER.

Start by opening an administrative command prompt. You do this by clicking on the Start Menu, typing cmd and pressing CONTROL-SHIFT-ENTER. You should get a confirmation prompt, and might need to enter an administrative password. Then, in the command prompt:

cd /d c:\
dir /ad

You should see a list of folders, including the folders you want to delete as well as various Windows folders such as Program Files and Users.

md empty
robocopy /e /purge /b empty abc123

What we've done here is to create an empty folder and tell Robocopy to copy it over top of the folder we're trying to delete. The /purge tells Robocopy to delete the files and the /b tells Robocopy to bypass file security. Robocopy will list the files in the folder as it deletes them, and will also produce a summary at the end showing how many files were deleted (look for the column titled Extras).

Repeat the robocopy command for each of the folders you want to delete. You don't need to repeat the md command each time.

Robocopy won't remove the folder itself, so we will do that separately:

takeown /F abc123
icacls abc123 /grant administrators:F
rd abc123

The first command takes ownership of the folder so that we can change the permissions, the second gives us permission to remove it, and the last line removes it. Repeat these three commands for each folder you want to delete.

Finally, we remove the empty folder we created, since we don't need it any more:

rd empty

Hope this helps.

4
  • Excellent solution!! That worked. One correction though. Instead of working on each folder saperately, I moved them all to a temp folder and did a Robocopy from Empty to Temp. Had to run it single time and end of all the problem I have 23 Gb of free space now. Thanks!!
    – Lost
    May 13, 2012 at 0:19
  • I wasn't sure whether you would be able to move the folders or not, so I gave the general solution. Glad you've got it sorted out. May 13, 2012 at 0:48
  • 1
    worked perfectly, thank you. my laptop left the files there when it powered down during updates due to low battery levels. Feb 28, 2013 at 23:59
  • 1
    awesome! this just freed up 60GB on my machine!
    – RBZ
    Mar 16, 2013 at 19:47
5

To get access to G:\Windows using takeown/icacls on Powershell

ls -r 'G:\Windows' | select -expand fullname | %{ takeown /f $_; icacls $_ /grant administrator:F }

Then, delete.

Using takeown/icacls recursively did nothing for me. This runs in on each individual item.

0
1

Go to the start menu and type in "cmd". Make sure you run it as administrator (right-click on cmd and select "run as administrator).

Then type in the folowing:

sc stop wuauserv
sc stop BITS

You should see a STOP_PENDING if successfull.
This will close the services automatic updates and background transfer service.

Now try to delete them.

2
  • 2
    The usual reason those folders can't be easily deleted is that they have extremely restrictive ACLs. Stopping the services is unlikely to help, though it's worth a try. May 12, 2012 at 23:20
  • 1
    Nops that did not help!!!
    – Lost
    May 13, 2012 at 0:06
0

Try rebooting the PC first. I had the same problem but it turns out it was related to an uninstall process that didn't inform me that it needed to reboot before it would finish removing everything.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .