Windows 10 – Unable to Uninstall Universal Apps via PowerShell

powershellwindows 10windows-store-app

I was in the process of uninstalling all the Universal Apps from a new Windows 10 installation when I hit a roadblock.

It's not the first time I do this and it always goes well. However, this time, whenever I write in PowerShell

Get-AppxPackage -allusers | Remove-AppxPackage

or something more specific like

Get-AppxPackage -allusers *windowscalculator* | Remove-AppxPackage

I get the following message:

Remove-AppxPackage : Deployment failed with HRESULT: 0x80073CFA, Removal failed. Please contact your software vendor. (Exception from HRESULT: 0x80073CFA)
error 0x80070032: AppX Deployment Remove operation on package Microsoft.WindowsCalculator_10.1605.1582.0_x64__8wekyb3d8bbwe from: C:\Program
Files\WindowsApps\Microsoft.WindowsCalculator_10.1605.1582.0_x64__8wekyb3d8bbwe failed.

This app is part of Windows and cannot be uninstalled on a per-user basis. An administrator can attempt
to remove the app from the computer using Turn Windows Features on or off. However, it may not be possible to uninstall the app.

NOTE: For additional information, look for [ActivityId] 75c5fc31-fb20-0001-77fd-c57520fbd101 in the Event Log or use the command line Get-AppxLog -ActivityID
75c5fc31-fb20-0001-77fd-c57520fbd101

At line:1 char:49

+ Get-appxpackage -allusers *windowscalculator* | Remove-AppxPackage
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Windo...__8wekyb3d8bbwe:String) [Remove-AppxPackage], IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.RemoveAppxPackageCommand

I'm getting this message for every single app I try to uninstall, including those I know are perfectly uninstallable like the calculator or image viewer, which has never happened before.
Powershell is running elevated and everything else works and seems normal.

Is there something I can do besides reinstalling Windows?

Best Answer

Starting with Windows 10 Anniversary update, Microsoft added a new entry IsInbox in the SQLite database C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Machine.srd for the inbox apps. And trying to remove app app flagged as IsInbox fails with 0x80073CFA.

But there is an ugly workaround, that was discovered in April 2017.

You need to download and install the tools ProcessHacker and DB Browser for SQLite.

  • run ProcessHacker 2 as admin, select a C:\Windows\System32\svchost.exe, do a rightclick and select Misc->Run as this user

enter image description here

Now select here C:\Program Files\DB Browser for SQLite\DB Browser for SQLite.exe and start it. In SQLite Browser, click on Open database

enter image description here

and open the file C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Machine.srd (change the file type in open dialog to all files to see it).

Now, click on the Browse Data tab, and change the table to Package

enter image description here

Now select the apps you want to remove and change the 1 for the column IsInbox to 0 and save the changes.

enter image description here

repeat this for all apps you want to remove and now the PowerShell commands should work.

But the author writes that Microsoft blocks the upgrade to newer Windows builds if inbox apps are removed. So keep this in mind.

Related Question