Windows 7/8 Tip: Deleting Folders (Access is Denied)

Windows 7/8 Tip: Deleting Folders (Access is Denied)

From time to time, when attempting to delete folders, Windows may deny you that ability and may pop up an error message that states “Access is denied”. Windows work in funny ways. This happened to me recently when I was trying to remove Windows.old which contained old Windows installation files that had been left behind after I upgraded to Windows 8. There was one specific file which couldn’t be removed and it irritated me to see the folder still there (signs of OCD).

The reason for Windows denying access is largely attributed to the ownership rights of either the file, folder, drive, registry key objects in Windows 7 or Windows 8. This is a safety measure to prevent you from deleting crucial files. So be careful with what you are deleting.

Otherwise, it is pretty much straightforward to perform.

In my case, the Windows.old folder contains a copy of the previous Windows installation, and can be quite large in size. Also, if you already had a C:Windows.old folder in the installation that you performed a refresh, upgrade install, or a custom install on, then it may be renamed to say C:Windows.old.000 (older previous installation) in addition to the C:Windows.old folder. The most recent previous installation will always be in the C:Windows.old folder. They are safe to delete once you confirm that you have all the necessary files transferred over.

  1. Press the Start Button
  2. Type “CMD”
  3. Move your mouse over the Command Prompt icon, right click and select Run As Administrator
  4. A Windows permission box would pop up for you to grant administrator access to the command prompt.
  5. Next, a command prompt box would appear and the first line should be C:WindowsSystem32. This would confirm that its in Administrator mode
  6. Type in the following command (exclude the brackets) at the command prompt to remove the directory. (RD /S /Q “C:Windows.old”)

And that’s it. Replace the folder directory in the quotations to other files / folders that you are having problems with. There are a couple of methods, which involved either deleting the folder when your computer is booting up, or to take ownership of the folder. This method above is by far the easiest. Let me know if it works for you.

2 Replies to “Windows 7/8 Tip: Deleting Folders (Access is Denied)”

  1. Well, I was happily expecting that to work, but what happened was that the command scrolled through the 100’s of files under windows.old and every time said “Access is denied”. And, yes, I was in Administrator mode.
    And I have also tried to change the ownership of the folders/files. No luck.
    Any other ideas?

    Thanks!
    Todd

  2. Hi Todd,

    Open Disk Cleanup by clicking the Start button . Type Disk Cleanup, and then, in the list of results, click Disk Cleanup (Windows 7) or “Free Up Disk Space by deleting unnecessary files” (Windows 8).

    If you’re prompted to choose a drive, click the drive you just installed Windows on, and then click OK.

    In the Disk Cleanup dialog box, on the Disk Cleanup tab, click Clean up system files.

    If you’re again prompted to choose a drive, click the drive you just installed Windows on, and then click OK.

    Select the Previous Windows installation(s) check box, and any other check boxes for the files you want to delete, and then click OK.

    In the message that appears, click Delete Files.

    If this method still doesn’t work – create a bootable ubuntu disk and delete the folder from ubuntu.