4

I've Googled all over the place on how to remove the built in Windows 10 Apps like 3D Builder, Zune, Xbox, etc from a Windows 10 image file.

All of the tutorials always point to the same thing - Remove-AppxProvisionedPackage - which is what I'm trying to do.

Whenever I try to remove the package, I always get a The System cannot find the file specified error.

This is the output I'm getting from mounting the image until I try to remove the package.

Trying to remove individual packages or the whole shebang gives me the same result.

PS C:\wds> Mount-WindowsImage -ImagePath .\2016-Test-Export.wim -Path .\mnt -Index 1

Path          : .\mnt
Online        : False
RestartNeeded : False

PS C:\wds> Get-AppxProvisionedPackage -Path .\mnt

DisplayName  : Microsoft.3DBuilder
Version      : 11.1.9.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.3DBuilder_11.1.9.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.BingWeather
Version      : 4.16.15.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.BingWeather_4.16.15.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.DesktopAppInstaller
Version      : 1.8.5001.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.DesktopAppInstaller_1.8.5001.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.Getstarted
Version      : 4.1.15.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.Getstarted_4.1.15.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.Messaging
Version      : 2.7.1001.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.Messaging_2.7.1001.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.MicrosoftOfficeHub
Version      : 2015.7420.23751.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.MicrosoftOfficeHub_2015.7420.23751.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.MicrosoftSolitaireCollection
Version      : 3.12.10310.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.MicrosoftSolitaireCollection_3.12.10310.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.MicrosoftStickyNotes
Version      : 1.1.41.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.MicrosoftStickyNotes_1.1.41.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.Office.OneNote
Version      : 2015.7466.57771.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.Office.OneNote_2015.7466.57771.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.OneConnect
Version      : 1.1607.6.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.OneConnect_1.1607.6.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.People
Version      : 2016.1011.2336.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.People_2016.1011.2336.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.SkypeApp
Version      : 11.9.251.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.SkypeApp_11.9.251.0_neutral_~_kzf8qxf38zg5c

DisplayName  : Microsoft.StorePurchaseApp
Version      : 11608.1000.24314.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.StorePurchaseApp_11608.1000.24314.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.Windows.Photos
Version      : 2016.722.10060.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.Windows.Photos_2016.722.10060.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsAlarms
Version      : 2016.1010.1800.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsAlarms_2016.1010.1800.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsCalculator
Version      : 2016.809.14.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsCalculator_2016.809.14.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsCamera
Version      : 2016.816.20.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsCamera_2016.816.20.0_neutral_~_8wekyb3d8bbwe

DisplayName  : microsoft.windowscommunicationsapps
Version      : 2015.7369.40827.0
Architecture : neutral
ResourceId   : ~
PackageName  : microsoft.windowscommunicationsapps_2015.7369.40827.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsFeedbackHub
Version      : 1.1608.2441.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsFeedbackHub_1.1608.2441.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsMaps
Version      : 2016.921.2109.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsMaps_2016.921.2109.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsSoundRecorder
Version      : 2016.808.1111.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsSoundRecorder_2016.808.1111.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.WindowsStore
Version      : 11610.1001.104.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.WindowsStore_11610.1001.104.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.XboxApp
Version      : 2016.1006.321.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.XboxApp_2016.1006.321.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.XboxIdentityProvider
Version      : 2016.719.1035.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.XboxIdentityProvider_2016.719.1035.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.ZuneMusic
Version      : 2019.16092.10311.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.ZuneMusic_2019.16092.10311.0_neutral_~_8wekyb3d8bbwe

DisplayName  : Microsoft.ZuneVideo
Version      : 2019.16092.10311.0
Architecture : neutral
ResourceId   : ~
PackageName  : Microsoft.ZuneVideo_2019.16092.10311.0_neutral_~_8wekyb3d8bbwe

PS C:\wds> Get-AppxProvisionedPackage -Path .\mnt | Remove-AppxProvisionedPackage -Path .\mnt
Remove-AppxProvisionedPackage : The system cannot find the file specified.
At line:1 char:42
+ ... sionedPackage -Path .\mnt | Remove-AppxProvisionedPackage -Path .\mnt
+                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

I must be missing something but just can't work out what I'm missing. I've also tried doing the same thing with DISM and run into the same error, system cannot find the specified file.

The Get-AppxProvisionedPackage finds the packages, so they exist... Any ideas on how to remove these?

Edit: Using the syntax suggested by Slipeer:

PS C:\wds> Get-AppxProvisionedPackage -Path .\mnt | foreach{ Remove-AppxProvisionedPackage -path .\mnt -PackageName $_.PackageName }
Remove-AppxProvisionedPackage : The system cannot find the file specified.
At line:1 char:51
+ ...  | foreach{ Remove-AppxProvisionedPackage -path .\mnt -PackageName $_ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
+ FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

<Repeated for all the packages>

Edit: I've also tried this script - https://gallery.technet.microsoft.com/Removing-Built-in-apps-65dc387b - also the same result.

Lawrence
  • 380
  • 2
  • 10

3 Answers3

1

As I understand it cmdlet Remove-AppxProvisionedPackage works differently: the package name must be passed in parameter -PackageName

Try:

Get-AppxProvisionedPackage -Path .\mnt | foreach {Remove-AppxProvisionedPackage -Path .\mnt -PackageName $_.PackageName }

But it makes no sense to do it in an offline image. Removed component is restored when you install an update that contains fixes for it. Updates are released every month.

It is better to implement the cleaning of unnecessary components on a regular basis (such as through the Task Scheduler).

Slipeer
  • 3,255
  • 2
  • 18
  • 32
  • I've also tried with `Remove-AppXProvisionedPackage -path .\mnt -PackageName Microsoft.ZuneMusic_2019.16092.10311.0_neutral_~_8wekyb3d8bbwe` and that didn't work either, same issue, and we'll also be monthly cleaning as well, but in the mean time, the users are waiting ~10 minutes to login on first login after we finish imaging which isn't ideal. This is for a school and students only have 50 minute periods. – Lawrence Nov 13 '16 at 07:51
  • You got the package name string from cmdlet `get-appxprovisionedpackage` ? This line may vary (depending on the installed updates) for different systems. – Slipeer Nov 14 '16 at 06:42
  • Yes, I got the name from get-appxprovisionedpackage. The name I replied with is on the bottom of the list in my OP. – Lawrence Nov 15 '16 at 00:46
  • +1 for mentioning that the apps you remove will come back on patch day – Jim B Apr 12 '17 at 16:05
1

I ran into the exact same problem. Running the native dism version of the command got me error messages in the dism log about "failed to get staged packages for package". And googling that led me to this page on edugeek.

So the user there noticed that if he went back to the original 1607 ISO, the commands worked fine. Likewise, I tried the same commands with the 1703 ISO I had, and everything works. So it appears something is up with some of the WIM files Microsoft is distributing. (The one that was problematic for me was 1607 updated Jan 2017, straight from my MSDN subscription.)

For now I plan to just use the original release media to get these provisioned apps uninstalled. Also, things may be improving more with respect to the provisioned apps coming back. Microsoft announced that starting in 1703, de-provisioned apps will stay de-provisioned after future feature update installations...

It doesn't help matters that Microsoft has (perhaps unintentionally) made it hard to get the original release media for some Windows 10 versions, even with an MSDN subscription. One way to get some of the original release media is outlined here

aggieNick02
  • 266
  • 2
  • 9
  • Thanks for that, I'll create new images with the Creators update and see how I go. – Lawrence Aug 09 '17 at 04:44
  • 1
    Just FYI, I tried doing this on the updated/slipstreamed 1703 (updated July 2017) ISO, and it works fine. So I guess we can hope whatever MS did wrong in making the 1607/1511 slipstreams has been corrected for slipstreams moving forward. – aggieNick02 Aug 21 '17 at 16:54
0

My first advice is to avoid PowerShell and rather dism.

  1. We need to extract the file (Windows10.iso with a software like 7zip, etc, etc).
  2. We need to mount the install.wim like this : Dism /Mount-Wim /Wimfile:C:\IsoW10\sources\install.wim /Index:1 /MountDir:C:\IsoWindows
  3. We need to obtain the PackageNames :Dism /Image:C:\IsoWindows /Get-ProvisionedAppxPackages >> C:\ProvisionedAppxPackagesW10.txt
  4. Now, we can remove the apps (and to give one example) :Dism /Image:C:\IsoWindows /Remove-Provisionedappxpackage /PackageName:Microsoft.3DBuilder_13.0.10349.0_neutral_~_8wekyb3d8bbwe
  5. We save it : Dism /Unmount-Wim /MountDir:C:\IsoWindows /commit

PS : About the file install.wim. As you can guess, yes you will find it in the folder sources. I had also create this pastebin which provide one good resume and a few more details. On the moment, I had forgot but the dism solution isn't perfect... Because it will remove almost everything (but no the last one such as : Microsoft.Windows.Apprep.ChxApp, Microsoft.Windows.ParentalControls, etc). If you want to check it, run one command (PowerShell) like : Get-AppxPackage | Select Name, PackageFullName. The website serverfault.com doesn't allow me to add another link...

  • I tried the same thing with DISM. The issue is that I get an error of `The System cannot find the file specified error.` when I try to remove the packages. – Lawrence Apr 19 '17 at 18:25
  • I had never met this error. Then @Lawrence could you give me more details ? A few examples : Did you check the path (and entirely) ? In which folder did you extract the file .iso ? (etc). Perhaps it will be better (or easier) for you to create a pastebin (post, etc); that's just one suggestion. Because I imagine the comment are limited... – Wagner_SOFC Apr 23 '17 at 00:36
  • There's really no other details to give apart from what I've specified in the OP. This isn't an ISO file, this is an image I'm using for WDS, so all I'm doing is mounting the WIM and trying to run the commands on the mounted WIM path. I've pretty much just ignored this issue for now and will probably return to this when I get around to creating a WDS image for the next deployment. – Lawrence May 02 '17 at 22:57
  • 1
    @Lawrence - see my answer. The issue is in the source media (ISOs) Microsoft is distributing when they have the slipstreamed updates. If you use the original release media for whatever Windows 10 version you want, it will work. – aggieNick02 Aug 02 '17 at 23:22