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.
Getting an error?
Are you see 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!