Lately, I've been quite annoyed at the fact that I can't edit files in C:\Program Files\WindowsApps folder. I've used the takedown command, in elevated CMD, and changed permissions, to allow admins to have full control (I am an admin), and changed owner to Administrators. I can delete files/folders, yet, whenever I try to edit files, or add files, I get the error message "Access is denied." How do I enable creating files and editing files in WindowsApps?
Windows – Editing/Creating files in C:\Program Files\WindowsApps
permissionswindowswindows-10-preview
Related Solutions
- Open a Command Prompt with administrative privileges.
Run following commands, one at a time (change "Z:\Program Files" with folder you want to delete):
takeown /F "Z:\Program Files" /A /R /D Y icacls "Z:\Program Files" /T /grant administrators:F rd /s /q "Z:\Program Files"
Note 1 - OS Language: takeown ... /D Y
The input Y stands for 'Yes' and will be different depending on OS Language. Program Files folder may also be named differently.
Note 2 - Older versions of Windows: If icacls
and rd
are not supported then try use cacls
and rmdir
instead
Explanation and documentation:
The issue might be that you do not have the correct permissions in the discretionary access control lists (DACLs) for the folder and its content. DACLs identifies the trustees that are allowed or denied access to a securable object. So simply giving the ownership to the folder might not be enough, but you also needs to grant permission in the DACLs. You can grant permission using the icacls command as shown as example above. Access Control Lists and DACLs explained
takeown takeown documentation Administrator recovers access to a directories and it's content that previously was denied, by making the administrators group the owner. /F [directory] specifies which directory, /A gives ownership to administrators group, /R performs it as recursive operation on directory, all files and sub-directories, /D suppresses confirmation prompts when user does not have "List Folder" permission with following Y option which take ownership of the directory. (Note: The Y option may be different depending on OS language).
icacls icacls documentation Grants the administrators group full access DAC permissions to directory. [directory] specify which directory, /T performs the operation on all specified files in directory and sub-directories, /grant grants specified user access rights with :F which gives full access. (Note: The group name administrators may be different depending on OS language)
rd rd documentation Deletes the directory with all its sub-directories and files. /s deletes the specified directory and its sub-directories including all files, /q specifies quiet mode so you get no prompt for confirmation, [directory] specify which directory to delete.
Open the Fonts folder located at C:\Windows\Fonts Right-click the font you want to remove, and click Delete
If that doesn't work, you may have to edit the registry to remove the font references before deleting the .TTF files (on next reboot)
Registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
See "Uninstalling a Font Manually Using Regedit" @ How to Reset Default System Font Settings (to Segoe UI) in Windows?
Best Answer
The
WindowsApps
folder is one of the most heavily protected folders in Windows 10. It contains all the Windows UWP apps, to which Microsoft zealously guards the access. The protections on this folder may change across Windows versions.The usual methods of taking ownership and assigning permissions are not enough for this folder, but are still required as first step to gaining access. After executing them, accessing the folder is now possible for copying, but editing is still blocked. To edit, one needs to save the file elsewhere, and only then replace the original with the edited version.
A further note is that restoring the ownership of the folder to
TrustedInstaller
is possible without losing the extra permissions that were assigned, by using the command:If someone wishes to use an elevated Command Prompt for gaining access to the folder, then these are the commands :
I also note that permission problems can be avoided by using the following commands before and after changing permissions to completely restore the original permissions :
To complement the poster's remark about restoring the original permissions on the folder while not having saved these permissions before starting, this is done by entering in an elevated Command Prompt (cmd) the command :
If the command does not work, it needs to be redone from a Windows boot CD/USB, as explained in the post Reset default ACLs for C:\Program Files\WindowsApps:
C:
will be the boot media, with your Windows system disk likely inD:
, so verify usingdir D:
, and if not, then search for the right drive-letterUsing the drive letter you just found (maybe
D:\
), issue the command:Wait for the operation to complete, and check the output for errors