it took me 2 days of searching for this answer and it worked the first time I did it.
My history with this issue goes back to april 2018 update to version 1803.
This answer is what I was looking for as my hard drive was failing at the time, I cloned my drive to a new HDD and fixed most of the issues but the update would fail everytime. After installing the update to 1809 from an ISO mount to a drive the black screen
would appear with the mouse cursor after login but nothing else even the Task Manager would not seem to start.
I restarted in safe mode with command prompt and after login the only thing that started was the command prompt window the desktop did not start.
I tried to start Task Manager and after 10 minutes the Task Manager appeared but was slow as hell and stopped responding. I was able to see explorer.exe had started twice, and I could start other programs that did not rely on Windows API or the system to
run, they started up right away no delay at all. This lead me to try the method posted here.
My conclusion is that at least 1 of the 6 files had been corrupted when my old HDD had started to fail as there where a bunch of other files that had been corrupted at the time SFC.exe had reported that much and after replacing them by copying them from
my laptop my PC would boot and 99.9% of the issues were gone but the update to 1803 would fail.
After applying this fix my PC now works as if nothing had ever happened and all remaining issues were resolved.
What I did was to create a batch file and put it into the root directory of my system drive, reboot into recovery mode > command prompt the changed the current drive and searched the root directory untill I found the root directory that contained the batch
file I created "updatefix.cmd" and then ran the batch file and restarted my PC into normal mode and everything started properely.
My batch file is the following lines of code:
cd "ProgramData\Microsoft\Windows\AppRepository"
ren "StateRepository-Deployment.srd" "StateRepository-Deployment-Corrupted.srd"
ren "StateRepository-Deployment.srd-shm" "StateRepository-Deployment-Corrupted.srd-shm"
ren "StateRepository-Deployment.srd-wal" "StateRepository-Deployment-Corrupted.srd-wal"
ren "StateRepository-Machine.srd" "StateRepository-Machine-Corrupted.srd"
ren "StateRepository-Machine.srd-shm" "StateRepository-Machine-Corrupted.srd-shm"
ren "StateRepository-Machine.srd-wal" "StateRepository-Machine-Corrupted.srd-wal"
Thanks man!! I'm on it for a week at least..
I was very skeptical about this but so frustrated that I had to give it a go... and it worked!!
Though I had to perform some more actions during the process, documenting for the sake of others:
I did everything as written, but executing the batch file in safe mode returned an error message "access is denied" when trying to rename the files.
I had to login back in non-safe mode and set permissions as suggested here:
https://ngambawm.wordpress.com/2014/03/05/how-to-take-the-ownership-of-apprepository-folder/
then tried the batch file again, the StateRepository-Deployment* files were renamed but the StateRepository-Machine* files returned an error saying "The process cannot access the file..." (I don't remember the exact wording).
again I logged in to non-safe mode and found out that the files are being used by a process.
To stop that process, Run 'services.msc', scroll down to the service "State Repository Service", right-click and Stop.
You'll get a warning message that 2 other services would have to stop. approve.
Then I just went to c:\ProgramData\Microsoft\Windows\AppRepository , found the StateRepository-Machine* files and renamed them as suggested.
I restarted and everything's back to normal! and my start button works! unbelievable...
Thanks!