If you are trying to run sfc /scannow and you may receive the following error message:
“There is a system repair pending which requires reboot to complete. Restart Windows and run sfc again.”
Here is how to resolve the error and get sfc /scannow to run again.
Step 1. Open an Elevated Command Prompt
You can try to run this from an elevated command prompt either in normal or safe mode but if required you may need to run it from the Windows Recovery Console.
Step 2. Run the following command
dism.exe /image:C:\ /cleanup-image /revertpendingactions
Step 3. Run sfc /scannow again
Restart the computer and type in the following again from an elevated command prompt
sfc /scannow
As before you may need to do this in safe mode particularly if the reason for running this command is because the computer has been infected with a virus or malware.
Click to rate this post!
[Total: 56 Average: 3.4]
Error 87 running your method
Typically Error 87 occurs when spaces are missed when entering the commands. Try copying and pasting the code from this page and giving it a go again.
Not really. Error 87:
The /Image option that is specified points to a running Windows installation.
If you are having a pending repair issue because a Windows update failed (whether update to Windows 10 or one of the cumulative updates Windows 10 performs occasionally), the system thinks there is an update in process, that’s why error 87 happens.
I wish I had a solution, but I am still searching for it myself.
for anyone else that had the error 87 problem, it seems the image command dosent want to run on a running image of windows, but it works if you replace the “/image:c:\” to “/online” it should work. The full line would be “dism.exe /online /cleanup-image /revertpendingactions”
This worked for me Thanks Shrek 🙂
If you go to windows updates and see there is a pending installation then click on “restart now” it will install the update and you can run sfc /scannow afterward. Windows avoids doing lengthy installations if you just restart it from the power button.
Don’t let the “system repair pending” throw you, it may just be an update.
No go.
It completes the dism fine & asks to restart. However, I’m booting either from a DVD or USB of Win 10, so I doubt anything actually “takes” & I end up in a loop. I also tried letting it go to a normal boot & I end up at the same, black screen w/cursor– never get any further. SMART is not tripped & I was able to use Linux to move the important data before I began.
Checked my partition is correct (Diskpart) & run (at X:): sfc.exe /scannow /offbootdir=E:\ /offwindir=E:\Windows\ It tries to start sfc & then I get, “system repair pending”. I run the above dism cmd & it completes successfully & asks to restart. I do. Same thing. I tried it restarting w/o any recovery media & with- same thing in a loop. Chkdsk did find & fix empty space a long while back now (I think I’ve now been at this for over 5 hours, trying every, possible combo).
I read posts about renaming the pending.xml file, but it doesn’t seem to work for me in 10.
Help?
Doesn’t work for me. I get:
DISM: Error 1017
An error occurred while attempting to access the image.
A Google search for DISM error 1017 turns up nothing useful.
I get Error: 1017 (An error occurred while attempting to access the image). I know my “c” drive is actually “d” and have adjusted for it, so I don’t know why it isn’t finding it (infact I tried both c and d). This happens after running the DISM command. Here’s a log, in case you’re interested. I think I’m going to have to reload the OS, since nothing seems to work.
2016-12-16 13:34:21, Info DISM DISM.EXE:
2016-12-16 13:34:21, Info DISM DISM.EXE:
2016-12-16 13:34:21, Info DISM DISM.EXE: Host machine information: OS Version=6.1.7601, Running architecture=amd64, Number of processors=4
2016-12-16 13:34:21, Info DISM DISM.EXE: Executing command line: dism
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Getting the collection of providers from a local provider store type. – CDISMProviderStore::GetProviderCollection
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Provider has not previously been encountered. Attempting to initialize the provider. – CDISMProviderStore::Internal_GetProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Loading Provider from location X:\windows\System32\Dism\WimProvider.dll – CDISMProviderStore::Internal_GetProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Connecting to the provider located at X:\windows\System32\Dism\WimProvider.dll. – CDISMProviderStore::Internal_LoadProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Provider has not previously been encountered. Attempting to initialize the provider. – CDISMProviderStore::Internal_GetProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Loading Provider from location X:\windows\System32\Dism\FolderProvider.dll – CDISMProviderStore::Internal_GetProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Connecting to the provider located at X:\windows\System32\Dism\FolderProvider.dll. – CDISMProviderStore::Internal_LoadProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Provider has not previously been encountered. Attempting to initialize the provider. – CDISMProviderStore::Internal_GetProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Loading Provider from location X:\windows\System32\Dism\CompatProvider.dll – CDISMProviderStore::Internal_GetProvider
2016-12-16 13:34:21, Info DISM DISM Provider Store: PID=892 Connecting to the provider located at X:\windows\System32\Dism\CompatProvider.dll. – CDISMProviderStore::Internal_LoadProvider
2016-12-16 13:34:21, Info DISM DISM.EXE: Got the collection of providers. Now enumerating them to build the command table.
2016-12-16 13:34:21, Info DISM DISM.EXE: Attempting to add the commands from provider: WimManager
2016-12-16 13:34:21, Info DISM DISM.EXE: Getting the help information collection for the provider: WimManager.
2016-12-16 13:34:21, Info DISM DISM.EXE: Registering information from the help collection from provider: WimManager.
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(wimcommands) and category(localtoplevelhelp) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(cleanup-wim) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(remount-wim) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(mount-wim) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(unmount-wim) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(commit-wim) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(get-wiminfo) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Succesfully registered the Help Item with topic(get-mountedwiminfo) and category(wimcommands) for the provider(WimManager).
2016-12-16 13:34:21, Info DISM DISM.EXE: Attempting to add the commands from provider: FolderManager
2016-12-16 13:34:21, Info DISM DISM.EXE: Attempting to add the commands from provider: DISM Log Provider
2016-12-16 13:34:21, Info DISM DISM.EXE: Attempting to add the commands from provider: Compatibility Manager
2016-12-16 13:34:21, Info DISM DISM.EXE: Getting the help information collection for the provider: Compatibility Manager.
2016-12-16 13:34:22, Info DISM DISM.EXE: Image session has been closed. Reboot required=no.
2016-12-16 13:34:22, Info DISM DISM.EXE:
2016-12-16 13:34:22, Info DISM DISM.EXE:
2016-12-16 13:34:22, Info DISM DISM.EXE:
2016-12-16 13:34:22, Info DISM DISM Image Session: PID=892 Disconnecting the provider store – CDISMImageSession::Final_OnDisconnect
2016-12-16 13:34:22, Info DISM DISM Provider Store: PID=892 Disconnecting Provider: WimManager – CDISMProviderStore::Internal_DisconnectProvider
2016-12-16 13:34:22, Info DISM DISM Provider Store: PID=892 Disconnecting Provider: FolderManager – CDISMProviderStore::Internal_DisconnectProvider
2016-12-16 13:34:22, Info DISM DISM Provider Store: PID=892 Found the OSServices. Waiting to finalize it until all other providers are unloaded. – CDISMProviderStore::Final_OnDisconnect
2016-12-16 13:34:22, Info DISM DISM Provider Store: PID=892 Disconnecting Provider: Compatibility Manager – CDISMProviderStore::Internal_DisconnectProvider
2016-12-16 13:34:22, Info DISM DISM Provider Store: PID=892 Releasing the local reference to DISMLogger. Stop logging. – CDISMProviderStore::Internal_DisconnectProvider
wow that’s great bro thanks
Error 87:
Cleanup-image option is unknown
revertpendingactions option is unknown
Run the dism command in a recovery boot command prompt. You will probably need to substitute /image:c:\ to /image:d:\
I did and received error 2 scratch directory size insufficient.
For scratch directory, set the TEMP and TMP environment variables to a disk that has some free space.
To fix this just go to C:\windows\winsxs\pending.xml change the security permissions to full control then delete file.
Its that EZ!
Worked for me to fix a boot issue after August 2019 patch Tuesday updates killed half a dozen computers. Thanks!
Worked like a charm and got me back into the OS.
If you get an error…
make sure you are at the root of your boot drive first.
Thank you!
I know this is old article, but wanted to say thanks, this worked, when several other things I tried failed. could not get sfc scan to work even in safe mode. Offline mode told me there was a failed update needed completing (suspected that’s where things had gone wrong), but this suggestion here, resolved the problem and computer is now running properly again
Typically Error 87 occurs when spaces are missed when entering the commands.