Dism online restore health function gets error 0x80240021

Hi,

I have a desktop computer running Windows 8.1 Pro 64-bit. My computer suffered from an improper shutdown during a power outage. I am getting multiple error messages on logging in, and the sfc /scannow command shows several corrupt files, including msvcr80.dll and multiple others, preventing programs like Microsoft Word from running properly.

I am getting the message after running sfc /scannow in an elevated command prompt that
Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log %WinDir%\Logs\CBS\CBS.log. I used the findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt" command to get this log outputted to a sfcdetails.txt log, and it shows which files are corrupt.


I then decided to turn to DISM, in an elevated command prompt, to ensure the component store was good, so that SFC can fix the files. This is where I am getting lost.

Dism /Online /Cleanup-Image /CheckHealth states that: The component store is repairable. However, when I run Dism /Online /Cleanup-Image /RestoreHealth , I am told (after some minutes of it running) that DISM failed, no operation was taken, with an error code of 0x80240021.

Looking at the dism.log file, I am seeing a very long log. These are the initial lines:

[2344] Caller did not request sparse mount
[2344] Mounting new image.
Wim: [\\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim]
Image Index: [1]
Mount Path: [C:\WINDOWS\TEMP\35f47719-b059-4f12-b5ee-101b2768bade]
[2344] Wimserv process started for guid 5cf84338-3869-464a-8cdf-3266fc2b6432. Id is 1008
[1008] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[1008] Mounted image at C:\WINDOWS\TEMP\35f47719-b059-4f12-b5ee-101b2768bade.
[2344] [0x8007007b] FIOReadFileIntoBuffer:(1415): The filename, directory name, or volume label syntax is incorrect.
[2344] [0xc142011c] UnmarshallImageHandleFromDirectory:(511)
[2344] [0xc142011c] WIMGetMountedImageHandle:(2568)
[2344] [0x8007007b] FIOReadFileIntoBuffer:(1415): The filename, directory name, or volume label syntax is incorrect.
[2344] [0xc142011c] UnmarshallImageHandleFromDirectory:(511)
[2344] [0xc142011c] WIMGetMountedImageHandle:(2568)
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[2344] ImageUnmarshallHandle: Reconstituting wim at \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE\Winre.wim.
[1008] Received unmount request for image with guid 5cf84338-3869-464a-8cdf-3266fc2b6432.
[1008] Unmount for image at C:\WINDOWS\TEMP\35f47719-b059-4f12-b5ee-101b2768bade complete.


From what I can make, some file name or directory is incorrect? I can provide my dism.log file, my sfcdetails.txt log (obtained from the sfc /scannow function), and a screenshot of the Repair-WindowsImage -Online -RestoreHealth error message when I run it in PowerShell, but I don't know how to post attachments here.  I would appreciate any input on how I can run DISM correctly to fix my component store. Thank you.
Answer
Answer
I have been able to resolve the issue.  The key is to use the Dism /Online /Cleanup-Image /StartComponentCleanup command before Dism /Online /Cleanup-Image /RestoreHealth , and the component store was repaired.  SFC was then able to fix the remaining corrupted files.

131 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2020 Views 49,263 Applies to: