30 May 2016

Delete old Windows FolderEvery now and then, you upgrade your puter.

Let’s say you add an SSD. You copy your old hard drive’s contents to your shiny new SSD, and use your old HDD as a data-only drive. You boot from the new SSD, and poof! You’re done.

Well, sort of…

Your new E: drive is now only a data drive, but alas, there is still an E:\Windows folder, and it’s taking up lots of space.

So, you try to delete E:\Windows… Access Denied, you need permissions, and so on…!

There are a million and one articles out there about how to delete an old, unneeded Windows folder, but they usually involve some piece of software or complicated shenanigans.

Well, forget that! This method is a piece of cake…

So, you might download and try a tool like IOBit’s Unlocker. Well, okay, but that’s kind of unnecessary. And such tools can take a LOOONG time to finish their job.

There are two steps needed to remove old “system” folders like your E:\Windows directory (or whatever drive letter it may have):

  1. Take ownership of the folder
  2. Change permissions so you can successfully delete the folder (and its contents) after you own it

Now, normally, this involves much wailing and gnashing of teeth – or special software.

It’s the first step – taking ownership of the old Windows dir – that’s the biggest headache.

Well, fear not!

Step 1 – Take ownership of the old Windows directory

In Windows 10, right-click the Start button, and select Command Prompt (Admin).

In older versions of Windows, click Start, type “cmd“, right-click Command Prompt, and then choose Run as Administrator.

You need to copy/paste this command into the Admin Command Prompt you just opened:

takeown /f "E:\Windows" /R && icacls "E:\Windows" /grant administrators:F /c /l

Note that “E:\Windows” should be changed (twice!) to match the Windows or other folder you wish to remove.

Command Prompt Take Ownership

This step won’t delete anything yet. All it does is to recursively zoom through the folder you specify and give Administrator accounts on your puter (and therefore you!) control of the folder and all its contents.

Once it’s done running, you can close the Command Prompt window.

Step 2 – Set Permissions on the old Windows directory

Here, you need to navigate to your old Windows folder in File Explorer (Win-E).

Right-click the old Windows folder, and choose Properties.

Click the Security tab, and the click the Edit button:

Windows Folder Security Properties

On the Permissions for Windows dialog that appears, you need to select SYSTEM and TrustedInstaller, and click the Remove button for each.

Windows Folder Permissions Remove

Click OK (twice) to back out of the Properties dialogs when done. If prompted, say yes to applying the changes to all folders, blah blah blah.

Note that if you haven’t done the first step yet, the Remove button will be greyed out. So, take ownership first!

Delete the old Windows folder

Now, just delete the old, now-accessible Windows folder in Explorer. DONE!

If you’d like to be a bit more hardcore, you can open another Admin Command Prompt (as described above), and run the following command:

rmdir /S E:\Windows

Make sure you type the correct drive letter and path!

You can use this same technique to quickly and easily “unlock” other Windows system folders that refuse to be deleted.

Wasn’t that fun?

Delete an old Windows folder the easy way
Tagged on:         

5 thoughts on “Delete an old Windows folder the easy way

  • 30 May 2016 at 13:30
    Permalink

    Thanks for SYSTEM and TrustedInstaller trick! Never heard about ’em before 🙂

    Reply
  • 22 August 2016 at 00:14
    Permalink

    This doesn’t seem to work for me, followed all steps to the letter and deleting the folder using command prompt (admin) still gives me access is denied on every file.

    Reply
    • 22 August 2016 at 11:05
      Permalink

      It only works if you’re using an administrator account on your puter (which you probably are). In that case, try using IOBit’s Unlocker program. That has never failed me as a last resort, even if it is a bit pokey sometimes.

      Reply
  • 11 January 2017 at 18:09
    Permalink

    I posted my blog article linking to yours too soon. I followed your instructions to the “t” and am still getting access denied the whole way through. 🙁

    Reply
  • 11 January 2017 at 18:16
    Permalink

    I even tried IOBit’s Unlocker and still can’t delete.

    Says I require permission from my computer’s name, which I have, to make changes to this folder.

    I know I can boot from a different OS on a USB stick, but that’s not what my goal is here. My goal is to be able to do this from within Windows.

    Thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *