7

I have the following problem: I download an app using the Windows Store on Windows 10. The download failed, but the Windows Store does not seem to recognize that. If I go to that app's page on the Store, it will give me the option to download it again. However, the 130GB that it occupies are still allocated on my hard disk, and I can-t find any way to remove the directory. I know which directory it is, but giving myself permissions didn-t work. I also tried booting from Linux and doing sudo rm -rf, but I still get a "permission denied" error.

How do I delete this folder? The guys over at Microsoft Support couldn't help me at all, they even stopped responding after the third failed attempt

3
  • It is not possible for Linux not to have permissions on a Windows directory, Linux, does not even enforce NTFS permissions.
    – Ramhound
    Jul 29, 2019 at 2:38
  • 1
    The Linux delete issue might be caused by opening the partition read-only (e.g. if Windows had been hibernated). That said, deleting files from outside Windows could cause some issues. Try to uninstall the botched install: thewindowsclub.com/uninstall-windows-10-apps Aug 11, 2019 at 2:17
  • I tried several of the PowerShell answers without success. Only thing that worked for me was running a linux bash terminal (I use git bash), as administrator, then cd /c/Program\ Files/WindowsApps, and rm -r DIRECTORY_NAME, in my case rm -r Microsoft.YourPhone_1.2*
    – TooTone
    Oct 15, 2023 at 9:54

4 Answers 4

11

You could also check in Powershell to see if it shows up and then try removing it from there.

Run this in Powershell to list current packages

Get-AppxPackage -AllUsers | ft

If the app is found in the list then run (edit the NameOfApp)

Get-AppxPackage -AllUsers | where-object {$_.name -like "*NameOfApp*"} | Remove-AppxPackage
4
  • 3
    Run Powershell with Administrator privilege, this works for me.
    – Sulisu
    Mar 8, 2020 at 17:13
  • 3
    I received the error message (even in powershell with administrator mode) that I can't install it, as another user installed it. What worked was adding -AllUsers at the end, so Get-AppxPackage -AllUsers | where-object {$_.name -like "*NameOfApp*"} | Remove-AppxPackage -AllUsers - see answer here stackoverflow.com/a/50978329/936284 Feb 2, 2022 at 8:37
  • I just used the cmd window and deleted items using that command line Apr 29, 2022 at 10:49
  • This works, except for Microsoft.Windows.Photos Mar 12 at 17:46
7

Here are two methods that may help your situation.

1. Get Access to WindowsApps Folder in Windows 10 Manually.

To get access to the WindowsApps folder, right-click on the folder and then select the Properties option from the list of context menu options.

properties[1]

The above action will open the Properties window. Navigate to the Security tab, and click on the Advanced button appearing at the bottom of the window.

advanced[2]

Once the Advanced Security Settings window has been opened, click on the Change link. You will receive a UAC (User Access Control) prompt. Simply click on the Yes button to continue.

windowsapps-folder-click-change[4]

Now the window will show you all the permissions of the WindowsApps folder. As you can see, this folder belongs to the system, thus you are not able to access it. To change it, click on the Change link appearing next to TrustedInstaller.

windowsapps-folder-click-change-again[5]

The above action will open the Select User or Group window. Here, enter your administrator username and click on the Check Names button. This action will automatically fill in the object name. Now, click on the OK button to continue.

windowsapps-folder-enter-username[6

Here in the main window you can see that the owner of the folder has been changed to your specified administrator account. Before applying the change, make sure that the Replace owner on sub containers and objects checkbox is selected, otherwise you won’t be able to interact with other files and folders inside the WindowsApps folder.

After you’ve done everything, click on OK button to save the changes.

apply-permission-changes[7

As soon as you click on the OK button, Windows starts to change the file and folder permissions. This process may take some time, so sit back and wait until the process is completed.

permission-changing[8

Once the file and folder permissions have been changed, you can easily access it like any other folder in the Program Files folder as long as you are an administrator or have administrator rights.

inside-windowsapps-folder

2. TAKE OWNERSHIP

Another way to do these same steps is to download a registry Hack. To use the Hack, or context-menu method, download this Take Ownership registry hack. Install it, by extracting the ZIP file, double-click InstallTakeOwnership.reg and follow the instructions.

Take-Ownership

Next, go to your WindowsApps folder (C:Program Files by default, but you may need to unhide it by clicking View at the top of File Explorer, then ticking the Hidden items box).

Once you can see WindowsApps, right-click it and click the new Take Ownership button in the context menu. A Powershell prompt will open and run a command to take control of the folder. Once this is done, you can access WindowsApps!

take-ownership

Standard warning: Registry Editor is a powerful tool, make sure to back up the Registry (and your computer!) before making changes.

Back up the registry manually, or create a system restore point.

Back up the registry manually.

  1. From the Start menu, type regedit.exe in the search box, and then press Enter. If you are prompted for an administrator password or for confirmation, type the password or provide confirmation.

  2. In Registry Editor, locate and click the registry key or subkey that you want to back up.

  3. Click File > Export.

  4. In the Export Registry File dialog box, select the location to which you want to save the backup copy, and then type a name for the backup file in the File name field.

  5. Click Save.

Create a restore point

  1. From the Start menu, type create a restore point.

  2. Select Create a restore point from the search results.

  3. Choose Create, and then follow the steps to create a restore point.

2
  • 1
    Thanks! Section 1 worked for me. Some caveats though: do ensure that all apps on that folder are uninstalled and that the Windows Apps are not set to install to that drive.
    – NMS
    Nov 4, 2020 at 1:50
  • Registry hack hardly necessary: takeown.exe /f "folder-or-file" /r /d y && icacls.exe "folder-or-file" /grant administrators:F /t. Feb 14 at 19:14
2

Using powershell as admin and changing the name of the app accordingly:

cd "C:\Program Files\windowsapps"
takeown /F Microsoft.Minecraft* /r /d y
rm -r -fo Microsoft.Minecraft*
-2

My old method:

  1. run CMD as admin
  2. cd "\Program Files\WindowsApps" Adjust this as needed

Do the following for each folder you want removed. Make sure you 'uninstall' the app first, if it's installed. Replace "" with your folder name, no quotes needed since Microsoft makes all these folders without spaces.

takeown /f <folder> /r
icacls <folder> /grant everyone:f /t
rd <folder> /s/q

I have created a script using variable for the folder name, still working on a better version.

1
  • 2
    WindowApps does not exist. Your command also does not work as written
    – Ramhound
    Jan 22, 2021 at 3:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .