关于如何从 Windows 10 图像文件中删除内置的 Windows 10 应用程序(如 3D Builder、Zune、Xbox 等),我到处搜索。
所有的教程总是指向同一件事——Remove-AppxProvisionedPackage
这就是我想要做的。
每当我尝试删除包时,我总是会收到The System cannot find the file specified
错误消息。
这是我从安装图像直到我尝试删除包得到的输出。
尝试删除单个包裹或整个 shebang 会给我同样的结果。
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
我一定错过了一些东西,但就是无法弄清楚我错过了什么。我也试过用 DISM 做同样的事情并遇到同样的错误,system cannot find the specified file
.
Get-AppxProvisionedPackage 找到包,所以它们存在......关于如何删除这些的任何想法?
编辑:使用 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>
编辑:我也试过这个脚本 - https://gallery.technet.microsoft.com/Removing-Built-in-apps-65dc387b - 结果也一样。