[Fix] Cannot Delete WindowsApps folder on Non-System Drives

If you have changed the default app save location to an external hard drive or secondary drive, Windows will create three folders, namely, WpSystem, WindowsApps, and WUDownloadCache on the target drive.

You may later change your mind and revert the default save location to C:\. But you may be unable to delete the leftover WindowsApps folder on your secondary drive due to tight NTFS permissions assigned to the folder. The other two folders, WpSystem and WUDownloadCache can be deleted easily.

When you access the WindowsApps folder on your secondary drive, you may see the following message:

cannot delete windowsapps folder

You have been denied permission to access this folder.

And the Advanced Security Settings dialog shows the error:

Can't open access control editor. Unable to perform a security operation on an object that has no associated security.

cannot delete windowsapps folder

This article explains how to properly delete the leftover WindowsApps folder on your secondary or external hard disk drive(s).

How to Delete the WindowsApps folder on non-system drives

You must delete the WindowsApps folder on the non-system drive(s) only if it is not your default app save folder and doesn’t contain any apps. If you have any apps installed in the secondary drive, please uninstall them first.

Step 1: Uninstall the apps in non-system drives

In Settings → Apps & Features, you can filter the list of apps by drive letter (e.g., D:\). In the following example, I have two apps, namely, Instagram and Microsoft VS Code. The VS Code is not a UWP app, and hence it’s not installed in the WindowsApps folder.

I went ahead and uninstalled Instagram before wiping out the WindowsApps folder manually (in Step 3 below).

windowsapps external drive

Step 2: Revert the default app save location to the default

The default app save location can be changed by opening Settings → System → Storage → Change where new content is saved. Make sure it’s set to C:\ drive or your system drive.

cannot delete windowsapps folder

Changing the setting on the above page would update the DefaultVolumeKey registry value under the following key:



HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\PackageVolumes\

Step 3: Delete the WindowsApps folder on the non-system drive

The unused WindowsApps folder on your secondary drive or external hard drive can be deleted by taking ownership of the folder and assigning your account full control permissions for the folder.

(The procedure is the same as deleting the Windows.old folder using Command Prompt.)

To delete the WindowsApps folder on the D:\ drive, run these commands:

takeown /f d:\windowsapps /r

icacls d:\windowsapps /grant administrators:F /t

rd d:\windowsapps /s /q

cannot delete windowsapps folder

warning caution iconImportant: Don’t accidentally delete the WindowsApps folder on your C:\Program Files folder.

In some cases, the takeown command produces the following error:

ERROR: Access is denied.

In that case, please open Command Prompt as TrustedInstaller and carry out the steps.

Getting an error?

Are you seeing the following error message after running the above commands?

The process cannot access the file because it is being used by another process.

If so, it means that one of the apps installed on that location is currently open. Terminate the app, uninstall it as per the instructions in “Step 1” above, and repeat the deletion procedure.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

16 thoughts on “[Fix] Cannot Delete WindowsApps folder on Non-System Drives”

  1. Thanks, great guide!
    It help me solving the issue with windowsapps folder on secondary drive.
    Not sure why this folder was there, but perhaps from an older windows installation I had before.

    Reply
  2. Have to back up the other comments. Trying to set the permissions through the GUI was very unintuitive as someone ignorant to windows permissions and it left a few files still denying access.

    3-hours of wtf-ing at windows and this did the trick in 30 seconds.

    Thanks,

    And what on earth are the microsoft people doing with their time? 2020 Microsoft store makes me want to install Vista!

    Reply
  3. Doesnt work.. it just says

    E:\>rd e:\windowsapps /s /q
    e:\windowsapps\DeepSilver.56575194F7E04_1.0.11.0_x64__hmv7qcest37me – Access is denied.
    e:\windowsapps\MSIXVC\47E1F436-9B8A-4FD9-8639-1AA28B3A97BB – The process cannot access the file because it is being used by another process.
    e:\windowsapps\MSIXVC\47E1F436-9B8A-4FD9-8639-1AA28B3A97BB.xvi – The process cannot access the file because it is being used by another process.

    WHY the f** MICROSOFT still write software in 2020 ?!?! It is CLEAR they CANNOT.

    Reply
    • @Nayden: See if the instructions here helps:

      neowin.net/forum/topic/1383914-unable-to-delete-files-file-access-denied/
  4. i cleansed several bugged and leftover windows store games installations over several drives with this, its legit. from programfiles folder etc. i just renamed each at a time and ran the commands and then manually deleted them. its all clean now. fantastic guide! have my admoney.

    Reply
  5. I’m getting an error msg at the first command, “takeown…” Msg:”File ownership cannot be applied on insecure file systems; there is no support for ACLs.”

    The other two commands fail as well.

    Reply
    • @bebobily: FAT32 formatted drives do not support file permissions. That means you don’t need to run the takeown.exe and icacls.exe commands on a FAT32 drive.

    • The same problem is with exFAT drives, I managed to delete WindowsApps folder from NTFS drive, but no luck with exFAT

      “ERROR: File ownership cannot be applied on insecure file systems;
      there is no support for ACLs.”

  6. Very helpful article thank you.
    I had a WindowsApps folder on a non-os drive for game installations which I forgot to take care of before reinstalling Windows.
    After running the remove command I had 3 folders left with 3 different errors:
    – The system cannot find the file specified.
    – A device attached to the system is not functioning.
    – The system cannot find the path specified.

    After rebooting into safe mode and running remove again it deleted all 3.

    Reply
  7. WHAT THE HELL?
    none of these worked except yours THANK YOU so much I was surviving hell for 3 hours on this problem god loves you

    Reply
  8. Awesome worked great after setting, then changing back Storage Setting “Where new content is saved” to D drive then back to C drive.

    Reply

Leave a Reply to bebobily Cancel reply