2

enter image description here A lot of my customers (management) complain about all the free apps that come with Windows 10. They don't want them on their employee's computer. So after searching a while I found the Powershell snippet Get-AppxPackage -AllUsers | Remove-AppxPackage which does truly uninstall those apps from the computer and all profiles.

So I said to myself "what if people want the calculator back"? I went to the Microsoft store and found Windows Calculator but when I click on "Get" nothing happens. I see a little flicker in the lower left. A URL something to do with adclick but the app shows now signs of installing. I have tried it with Chrome and Edge. So did running the above snippet remove something where the apps won't re-install or even try to? How do you get Windows Calculator back?

  • https://www.askvg.com/guide-how-to-reinstall-all-default-built-in-apps-in-windows-10/ – Moab Jan 06 '21 at 16:14

1 Answers1

1

If you have only used Remove-AppxPackage to remove apps and have not further deleted their files from C:\Program Files\WindowsApps (NOT recommended), then the packages still exist in this folder and can be reinstalled (or rather re-registered).

To reinstall all apps, use an elevated PowerShell session to run:

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

To reinstall one app only, for example the calculator:

$manifest = (Get-AppxPackage *WindowsCalculator*).InstallLocation + '\AppxManifest.xml'
Add-AppxPackage -DisableDevelopmentMode -Register $manifest

For more information and a list of all the apps see the article
How to Reinstall and Re-register All Built-in Windows Apps in Windows 10.


From the discussion below, it seems like the user profile in question has been corrupted.

Such problems can very rarely be successfully analyzed and fixed. The usual advice is to migrate everything to a new user profile.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • As mentioned the only thing done (to remove them) was Get-AppxPackage -AllUsers | Remove-AppxPackage. The command you gave threw an error. Attached screen shot in original question. –  Jan 06 '21 at 20:08
  • I improved (and tested) the command for the calculator. – harrymc Jan 06 '21 at 20:41
  • I struggle with Superuser's format. Did you just overwrite the previous example with new code? If so it throws the same error. –  Jan 07 '21 at 14:36
  • Yes, I copy-pasted a new command command into my answer. It should work. Is PowerShell run as admin? – harrymc Jan 07 '21 at 14:39
  • Yes. Powershell as admin. As kind of a footnote I know the packages are still there because when I log in as a new profile all the apps are back. –  Jan 08 '21 at 11:42
  • I took off the `powershell` prefix (which is rather for CMD). For clarity, I divided the two PowerShell commands into two lines. Sorry for the mixup. – harrymc Jan 08 '21 at 11:57
  • Thank you for the time you are putting in on this. Much appreciated. I posted a new screen shot. The error appears to be that it is looking for the manifest on the root of c: and it isn't there. –  Jan 08 '21 at 16:36
  • (1) What do you get for `(Get-AppxPackage *WindowsCalculator*).InstallLocation`. (2) In registry key `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx`, what is the value of `PackageRoot`? – harrymc Jan 08 '21 at 16:43
  • 1) does not return anything 2) C:\Program Files\WindowsApps –  Jan 08 '21 at 18:34
  • 1) was bad but 2) is correct. Apparently more destruction was done than just what you described. Perhaps you uninstalled the Windows Store. But I can't find from over here what was done to the computer. – harrymc Jan 08 '21 at 18:42
  • The command was Get-AppxPackage -AllUsers | Remove-AppxPackage and it did indeed remove Windows Store. So.... I created a different user. Logged in as that user. All apps were back (including Microsoft Store). Uninstall Windows Calculator then tried the above commands to bring it back. Same error. It is trying to find C:\AppxManifest.xml and it isn't there nor is it in the c:\Program Files\WindowsApps. So where is this elusive AppxManifest.xml? –  Jan 08 '21 at 19:02
  • Here is a mind fry. I copied "C:\Program Files\WindowsApps\DeletedAllUserPackages\Microsoft.WindowsCalculator_10.1812.10048.0_neutral_split.scale-125_8wekyb3d8bbwe\AppxManifest.xml" back to the root of C: and your command worked. Calculator is back. –  Jan 08 '21 at 19:09
  • This means that you have destroyed Windows files. This is really bad practice. – harrymc Jan 08 '21 at 19:39
  • I think we are shooting at a moving target. I googled some commands to restore the default apps (all of them) and they do not work. I am on the 2004H2 release and I have a feeling that every time M$ comes out with a new release that the way things are done with these apps changes. –  Jan 12 '21 at 14:00
  • You should never *never* modify the permissions on WindowsApps, but it looks to me that this was done. Try maybe [this answer](https://superuser.com/a/1489511/8672). If nothing helps, the only suggestion I have is to do [In-place Upgrade](https://www.tenforums.com/tutorials/16397-repair-install-windows-10-place-upgrade.html). – harrymc Jan 12 '21 at 15:17
  • I am not sure where anyone got the idea that I changed app permissions or deleted files. If you read the above comments I have stated several times that all I did was: Get-AppxPackage -AllUsers | Remove-AppxPackage and that if I logged in as a new users that all the apps were back. –  Jan 12 '21 at 18:23
  • In that case, the `.appx` files are indeed intact, but your user profile is corrupted. Such problems are very rarely fixable, and the usual advice is just to migrate everything to a new profile. – harrymc Jan 12 '21 at 20:02