Removing Windows 10 Built In Apps from a Windows 10 Image
Solution 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
Solution 2
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).
Related videos on Youtube
Lawrence
Updated on September 18, 2022Comments
-
Lawrence almost 2 years
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 over 7 yearsI'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. -
Slipeer over 7 yearsYou got the package name string from cmdlet
get-appxprovisionedpackage
? This line may vary (depending on the installed updates) for different systems. -
Lawrence over 7 yearsYes, I got the name from get-appxprovisionedpackage. The name I replied with is on the bottom of the list in my OP.
-
raja about 7 years+1 for mentioning that the apps you remove will come back on patch day
-
Lawrence about 7 yearsI 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. -
Wagner_SOFC about 7 yearsI 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...
-
Lawrence about 7 yearsThere'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.
-
aggieNick02 almost 7 years@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.
-
Lawrence almost 7 yearsThanks for that, I'll create new images with the Creators update and see how I go.
-
aggieNick02 almost 7 yearsJust 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.