When I attempt to remove provisioned apps from an offline Windows 8.1 image, most of the apps I want to remove cause no problem, but attempting to remove Microsoft.Office.OneNote causes an error.
The following PowerShell code demonstrates the problem. The operating system is Windows PE 5.0. (Why WinPE? My goal is to remove some provisioned apps during a System Center Configuration Manager 2012 R2 task sequence before the new installation boots for the first time.) The offline image is Windows 8.1 with updates through 30-Apr-2015 installed, and it is located at the root of drive G:.
PS > Get-AppxProvisionedPackage -Path G:\ ... [lines omitted] ... DisplayName : Microsoft.Office.OneNote Version : 2014.215.704.4136 Architecture : neutral ResourceId : ~ PackageName : Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe ... [lines omitted] ... DisplayName : Microsoft.ZuneMusic Version : 2014.228.1317.652 Architecture : neutral ResourceId : ~ PackageName : Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe ... PS > Remove-AppxProvisionedPackage -Path G:\ -PackageName Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe Path : G:\ Online : False Restart Needed : False PS > Remove-AppxProvisionedPackage -Path G:\ -PackageName Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe Remove-AppxProvisionedPackage : The system cannot find the file specified. At line:1 char:1 + Remove-AppxProvisionedPackage -Path G:\ -PackageName Microsoft.Office.OneNote_20 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand
Here are excerpts from the %SystemRoot%\Logs\DISM\dism.log file.
Removal of Microsoft.ZuneMusic:
2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Enter DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Initialized default cancel event - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1068 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1068 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Getting Provider AppxManager - CDISMProviderStore::GetProvider 2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider 2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Loading Provider from location X:\windows\TEMP\D173D978-C7E2-4153-88D4-A35376D8C923\AppxProvider.dll - CDISMProviderStore::Internal_GetProvider 2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Connecting to the provider located at X:\windows\TEMP\D173D978-C7E2-4153-88D4-A35376D8C923\AppxProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2015-06-08 14:43:29, Info DISM DISM Provider Store: PID=1848 TID=1440 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider 2015-06-08 14:43:29, Info DISM API: PID=1444 TID=1068 Calling RemoveAllUserAppx with package full name = Microsoft.ZuneMusic_2014.228.1317.652_neutral_~_8wekyb3d8bbwe - CRemoveAppxCommandObject::InternalExecute 2015-06-08 14:43:29, Info DISM DISM Appx Provider: PID=1848 TID=1440 Writing temporary provision file: X:\windows\TEMP\appxStage-{77DB0339-427B-481D-BC0D-88B930DBA99A}\AppxProvisioning.xml. - CDismContext::FinalizeChanges 2015-06-08 14:43:30, Info DISM DISM Appx Provider: PID=1848 TID=1440 Taking ownership of G:\ProgramData\Microsoft\Windows. - CDismContext::FinalizeChanges 2015-06-08 14:43:30, Info DISM DISM Appx Provider: PID=1848 TID=1440 Copying from X:\windows\TEMP\appxStage-{77DB0339-427B-481D-BC0D-88B930DBA99A}\AppxProvisioning.xml to G:\ProgramData\Microsoft\Windows\AppxProvisioning.xml. - CDismContext::FinalizeChanges 2015-06-08 14:43:30, Info DISM API: PID=1444 TID=1068 Successfully removed package - CRemoveAppxCommandObject::InternalExecute 2015-06-08 14:43:30, Info DISM API: PID=1444 TID=1636 Leave DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:43:30, Info DISM API: PID=1444 TID=1636 Enter DismCloseSessionInternal - DismCloseSessionInternal
Removal of Microsoft.Office.OneNote (with error lines in bold type):
2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Input parameters: Session: 2, PackageName: Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Initialized default cancel event - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Successfully enqueued command object - CCommandThread::EnqueueCommandObject 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=876 ExecuteLoop: CommandQueue signaled - CCommandThread::ExecuteLoop 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=876 Successfully dequeued command object - CCommandThread::DequeueCommandObject 2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Getting Provider AppxManager - CDISMProviderStore::GetProvider 2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider 2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Loading Provider from location X:\windows\TEMP\D613CBD7-929A-4C48-92DE-589E048B20EC\AppxProvider.dll - CDISMProviderStore::Internal_GetProvider 2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Connecting to the provider located at X:\windows\TEMP\D613CBD7-929A-4C48-92DE-589E048B20EC\AppxProvider.dll. - CDISMProviderStore::Internal_LoadProvider 2015-06-08 14:57:06, Info DISM DISM Provider Store: PID=2020 TID=848 Encountered a servicing provider, performing additional servicing initializations. - CDISMProviderStore::Internal_LoadProvider 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=876 Calling RemoveAllUserAppx with package full name = Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe - CRemoveAppxCommandObject::InternalExecute 2015-06-08 14:57:06, Error DISM DISM Appx Provider: PID=2020 TID=848 Failed to get staged packages for package 'Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe'. - CPackageAdapter::CreateForRemove(hr:0x80070002) 2015-06-08 14:57:06, Error DISM DISM Appx Provider: PID=2020 TID=848 Failed while initializing package adapter for package 'Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe' - CAppxManager::RemoveAllUserAppx(hr:0x80070002) 2015-06-08 14:57:06, Error DISM API: PID=1444 TID=876 Failed to remove package - CRemoveAppxCommandObject::InternalExecute(hr:0x80070002) 2015-06-08 14:57:06, Error DISM API: PID=1444 TID=876 InternalExecute failed - CBaseCommandObject::Execute(hr:0x80070002) 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Leave DismRemoveProvisionedAppxPackageInternal - DismRemoveProvisionedAppxPackageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismGetLastErrorMessageInternal - DismGetLastErrorMessageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Exit DismGetLastErrorMessageInternal - DismGetLastErrorMessageInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismDeleteInternal - DismDeleteInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Leave DismDeleteInternal - DismDeleteInternal 2015-06-08 14:57:06, Info DISM API: PID=1444 TID=1636 Enter DismCloseSessionInternal - DismCloseSessionInternal
The error returned from Remove-AppxProvisionedPackage is "The system cannot find the file specified." Which file?
The more detailed error message from the DISM log is "Failed to get staged packages for package 'Microsoft.Office.OneNote_2014.215.704.4136_neutral_~_8wekyb3d8bbwe'." What does this mean?
Although I found a blog article describing the Windows 8/8.1 app terminology that may hint at the problem—something about a staged version of the app—my searches for help on these specific errors have been fruitless. How can I find the causes of these errors?.