We had another employee’s computer get this error while installing Service Pack 1 for Windows 7 x64.  After poking around for some answer about how to fix the problem, I found most people were having sucess with running dism /image:c: /cleanup-image /revertpendingactions in Windows 7 Recovery Environment.  This seemed to be working for us, but ending up throwing “Error 2” and bailing out.  I pulled up the x:windowslogsdismdism.log and started searching through for a possible answer.  

Near the middle of dism.log, I found an error “Status_object_name_not_found” and a reference to the missing file in d:windowswinsxs.  I pulled a good copy from another Windows 7 x64 SP1 machines.  Reruning dism failed again with the same error, and the log found the same “Status_Object_Name_Not_Found” error.  Also dism.log would indicate a missing directory with the error “Status_Object_Path_Not_Found.”  Between these two errors, my co-worker and I replaced between 200-300 files, and directories.  

So the basic process from the command line in Windows Recovery Environment was:

dism /image:d: /cleanup-image /revertPendingActions
notepad x:windowslogsdismdism.log
copy g:windowswinsxsPathTomissingFile.xxx d:windowswinsxsPathToMissingFile
robocopy g:windowswinsxsMissingDirectory d:windowswinsxsMissingDirectory /e (For Missing Directories)
del x:windowslogsdismdism.log

Once we replaced all the missing file in Windows Recovery Environment, the computer started booting to Windows without any errors; in windows, we ran SFC from an administrative command prompt.  Reading through the SFC log the first time, some missing files from SP1 which I replaced with known good copies from another Windows 7 box.  These first missing files were found by using “findstr /c:”[SR] Cannot” c:windowslogscbscbs.log > c:sfcResults.txt.”  All the missing files are listed in sfcResults.txt.  After fixing these SFC did not show any errors from the above command, but said it found unrepairable errors.  Searching manually through cbs.log, I found a reference to “Status_Object_Path_Not_Found.”  After replacing the missing directory, and a reboot, we ran SFC; the findstr command above found more missing files, which were all in a single missing directory.  We replaced these, and that ended up being all the missing files.   

One note, is /revertPendingActions rolls back filesystem changes, and not changes to the registry.  So Service Pack 1 was seen by Windows as installed, and 99% of the files we replaced by hand were for Service Pack 1.  We had thought about using System Restore, but there was no restore data.