Windows Failure - Recovery Console (Steps and Commands)
Leave a comment below with the error, or anything else you think may be helpful to others, which these steps helped you resolve.
(Links at bottom for step-by-step instruction still for getting to Recovery Console and Safe Mode)
Run the below #1 command (steps) first to find out which drive letter is assigned to the Windows OS partition from the Recovery Console as it may not be the standard "C" drive as it is otherwise.
- From the Recovery Console type in
bcdedit
| find "osdevice"
pressEnter
and then look at the command output result.Where you see
osdevice partition=D:
(output result of the command per #1) whatever drive letter is afterparition=
is the drive letter you'll use in place ofC:\
in the below command so if it's~D=
then the below command will use~image:D:\ /cle~
in that part of the command.Warning: Ensure spaces are in the command and the forward and back slashes are just as typed.
From the Recovery Console type in
dism /image:C:\ /cleanup-image /revertpendingactions
, and pressEnter
- If you get the error. . .
The scratch directory size might be insufficient to perform this operation. This can cause unexpected behavior.
then. . .- type in (assuming OS is on "D" drive here)
MD D:\Scratch
pressEnter
then type inDISM /Image:D:\ /ScratchDir:D:\Scratch /Cleanup-Image /RevertPendingActions
pressEnter
to rerun the command.)If you still have trouble getting #2 to run from the Recovery Console, then try running the below command when logged onto Windows normally from the command prompt (run as administrator). If you're able to get #2 to run without error, then just skip the #3 step entirely.
- Type in
DISM /Online /Cleanup-Image /RevertPendingActions
from the command line run as administrator, and then pressEnter
.If you cannot get #2 or #3 to work above, then you may need to boot to a Linux OS or perhaps you can do from Recovery Console and rename the below file on the "C" drive location (or whatever drive letter Windows is on per #1 above still) which is the file that keeps records of where the OS is on pending Windows Updates, etc.
Once this file is renamed, then a new file will be created on the next Windows Update attempt but if you have to run this option to fix the issue, it may be best to do #5 before applying any new Windows Updates.
This is the file that you'll rename ->
C:\Windows\winsxs\pending.xml
Ensure you replace
C:\Windows\~
with the drive letter determined in #1 above here too
From the Recovery Console type in
CD /D "C:\Windows\winsxs"
pressEnter
Type in
REN "pending.xml" "bak_pending.xml.bak"
pressEnter
, reboot machine and complete #5 belowOnce that completes, boot to Safe Mode and then run the below command (optional):
- Type in
sfc /scannow
from the command line run as administrator, and pressEnter
.
NONE OF THIS IS WORKING!!!
A few last resort items to try in order and from the Recovery Console. . .
Anywhere a drive letter is anywhere on any of the commands, ensure the drive letter is what's determined per step #1 above.
CHKDSK D: /F /R
< Let this complete regardless of how long it takes to complete; kick it off, and just check in on it periodically.
SFC /SCANNOW /OFFBOOTDIR=D:\ /OFFWINDIR=D:\Windows
Important Note Installing Service Pack 1
Once you get this fixed, please download the Windows 7 Service Pack 1 manually (below download link), install it, and then reboot.
Be sure to not apply any Windows Updates via the Windows Update process until this is complete. Once Service Pack 1 is downloaded and installed, then move forward with the Windows Updates.
Download