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.