If you have changed the default app save location to an external hard drive or secondary drive, Windows will create three folders, namely,
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,
WUDownloadCache can be deleted easily.
When you access the
WindowsApps folder on your secondary drive, you may see the following message:
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.
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).
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.
Changing the setting on the above page would update the
DefaultVolumeKey registry value under the following key:
Step 3: Delete the WindowsApps folder on the non-system drive
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
Important: Don’t accidentally delete the WindowsApps folder on your
C:\Program Files folder.
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!
17 thoughts on “[Fix] Cannot Delete WindowsApps folder on Non-System Drives”
Thanks a lot this did help me very much. Infact you were the only guide on the internet who was able to help me!
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.
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.
And what on earth are the microsoft people doing with their time? 2020 Microsoft store makes me want to install Vista!
Doesnt work.. it just says
E:\>rd e:\windowsapps /s /q
e:\windowsapps\DeepSilver.56575194F7E04_22.214.171.124_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.
@Nayden: See if the instructions here helps:
Thank you so much, only this website help me with delete Windowsapps folder. Enjoy your money from ads 😀
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.
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.
@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.
I’m getting the same error
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.”
Where can I find the aftermath file in C drive can’t seem to be found as it ate parts of my storage
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.
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
Awesome worked great after setting, then changing back Storage Setting “Where new content is saved” to D drive then back to C drive.
Thank you its working I have space free after that 31GB
Code worked fine – thank you