How to: Delete/Remove protected folders and files from a previous installation of Windows


Problem: I’ve decided to re-install windows because of some issues. My new install is ok but I can’t delete the directory of my old windows anymore!

Solution: The folder you are trying to delete has it’s administrative privileges locked from your previous windows. You could change the ownership of your folder by right clicking on the folder -> Properties -> Security -> Advanced -> Owner -> Edit -> Select Administrator and put a check on “Replace owner on subcontainers and objects”

An Easier Solution: You can also do a command prompt to remove the ownership which is a more straightforward process. To do this, press your window’s Start button, type “cmd”, right click on the “cmd” program that shows up, right click and select run as administrator (running the command prompt with administrator privileges is important).

In the command prompt, enter the following command:

cacls “c:\WINDOWS.OLD” /t /g administrators:F

Note: Don’t forget to change the drive letter and path above to the locked folder.

That’s it! You can now delete this folder.

3 Comments on “How to: Delete/Remove protected folders and files from a previous installation of Windows”

  1. 1 miguel said at 4:29 AM on November 10th, 2009:

    Response was: access is denied

  2. 2 Notafake said at 4:05 PM on November 20th, 2009:

    First, thank you for this it helped me to delete Windows folders on a external Hard Disk, where not even the owner had Full Control (Funny Vista, your mine but i can’t delete you). But it didn’t work with only one of your solutions, just with both together. I took the ownership with your first method and the i forced the rights on command line. While not doing the first part, the cmd part refused “Access Denied”. So, if the problem still exists, do both in this order and you’ll be happy at all.

  3. 3 hyro said at 11:01 AM on March 16th, 2010:

    nice one…..thanks

Leave a Reply