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.
Best Answer
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 theTAB
key; when typing a command you can just enter the first two or three characters of the folder name and then pressTAB
. You need to pressENTER
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 pressingENTER
.Start by opening an administrative command prompt. You do this by clicking on the Start Menu, typing
cmd
and pressingCONTROL-SHIFT-ENTER
. You should get a confirmation prompt, and might need to enter an administrative password. Then, in the command prompt:You should see a list of folders, including the folders you want to delete as well as various Windows folders such as
Program Files
andUsers
.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 themd
command each time.Robocopy won't remove the folder itself, so we will do that separately:
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:
Hope this helps.