Answered by:
Refresh - DISM Apply-Image Access Denied - C:\Program Files\WindowsApps

Question
-
When refreshing a Windows 10 1607 PC MDT 8443 will fail when applying the image with an access denied error.
Here is the relevant error from dism.log:
2017-03-06 08:51:27, Info DISM DISM Provider Store: PID=840 TID=1244 Provider has previously been initialized. Returning the existing instance. - CDISMProviderStore::Internal_GetProvider [840] [0x80070005] RestoreDirMetadata:(2413): Access is denied. [840] [0x8144012d] 2017-03-06 08:51:34, Warning DISM DISM WIM Provider: PID=840 [RestoreDirMetadata:(2419) -> Error restoring directory metadata] D:\Program Files\WindowsApps\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe (HRESULT=0x80070005) - CWimManager::WimProviderMsgLogCallback [840] [0x80070005] RestoreDirMetadata:(2548): Access is denied. [840] [0x80070005] WimCreateDirectory:(3067): Access is denied. [840] [0xc144012e] 2017-03-06 08:51:34, Error DISM DISM WIM Provider: PID=840 D:\Program Files\WindowsApps\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe (HRESULT=0x80070005) - CWimManager::WimProviderMsgLogCallback [840] [0x80070005] RestoreDirTree:(3318): Access is denied. [840] [0x80070005] WIMApplyImageInternal:(704): Access is denied. 2017-03-06 08:51:34, Error DISM DISM WIM Provider: PID=840 TID=1244 base\ntsetup\opktools\dism\providers\wimprovider\dll\wimmanager.cpp:1046 - CWimManager::Apply(hr:0x80070005) 2017-03-06 08:51:34, Error DISM DISM Imaging Provider: PID=840 TID=1244 base\ntsetup\opktools\dism\providers\imagingprovider\dll\genericimagingmanager.cpp:2500 - CGenericImagingManager::InternalCmdWimApply(hr:0x80070005) 2017-03-06 08:51:34, Error DISM DISM Imaging Provider: PID=840 TID=1244 base\ntsetup\opktools\dism\providers\imagingprovider\dll\genericimagingmanager.cpp:535 - CGenericImagingManager::ExecuteCmdLine(hr:0x80070005)
What would be the best practice to avoid this? It only seems to happen intermittently. Should I remove AppX provisioned packages during the initialization sequence?
Monday, March 6, 2017 2:30 PM
Answers
-
As a note here.
I ended up building into the task sequence a job to take ownership and delete completely the GetOffice windows metro app folder. It has to be run from within the OS though so there's really no way to run an offline refresh. It's either an offline drive re-format or forcefully removing the files inside the OS prior to going into WinPE.
Seems to be just limited to the GetOffice app though so hopefully not widespread.
- Marked as answer by tiberriver256 Monday, April 17, 2017 8:26 PM
Monday, April 17, 2017 8:25 PM
All replies
-
The issue is identical to this but it is an appxpackage blocking the install instead of the Linux subsystem:
Wednesday, March 8, 2017 1:15 AM -
It's happen also on 1703 and what we should do with it, Microsoft?
Maybe instead adding suggesting apps in start menu and other crap you'll start improve quality of your product for those we paid?
Why DISM tool CAN CAPTURE image and then CAN'T APPLY it? It's so hard to attempt end user when he capturing image that the image can't be applied back? Why you do not implement "exclude files list" argument in DISM /Apply-image option?
How we can apply "broken" WIM that has WSL files inside?!
- Edited by Igor Chekrizoff Saturday, April 15, 2017 12:30 PM
- Proposed as answer by Bill Walls Monday, October 2, 2017 5:08 PM
Saturday, April 15, 2017 3:58 AM -
As a note here.
I ended up building into the task sequence a job to take ownership and delete completely the GetOffice windows metro app folder. It has to be run from within the OS though so there's really no way to run an offline refresh. It's either an offline drive re-format or forcefully removing the files inside the OS prior to going into WinPE.
Seems to be just limited to the GetOffice app though so hopefully not widespread.
- Marked as answer by tiberriver256 Monday, April 17, 2017 8:26 PM
Monday, April 17, 2017 8:25 PM -
Old question, but I think I found a quick solution if using WinPE. Prior to running (g)imagex to apply the image, just clobber the parent directories.
rd "c:\Program Files\WindowsApps" /s
rd c:\ProgramData\Microsoft\Windows\AppRepository" /s
Friday, July 17, 2020 10:47 AM -
Old question, but I think I found a quick solution if using WinPE. Prior to running (g)imagex to apply the image, just clobber the parent directories.
rd "c:\Program Files\WindowsApps" /s
rd c:\ProgramData\Microsoft\Windows\AppRepository" /s
Monday, August 3, 2020 4:28 AM