Most frequently I find such folders after windows update/install something. Unfortunately there is no way to disable them from being created. You can only hope that the update will finish OK and will cleanup after itself.
As for the deleting of these folders you just need to take ownership of them and you will be able to delete them.
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.
Best Answer
These are most likely leftovers from the installation process and it is safe to remove them.
However, just in case, I would first create a temporary directory on the same disk and move them into it. If no bad effects happen for several days, then they can be safely deleted.
If you get the "Access is Denied" error message even if you are the administrator, you will need to take control of these folders. For that, see the following article:
How to take ownership of a file or a folder in Windows XP