Windows Modules Installer Error:126

Anonymous
2009-10-29T22:22:40+00:00

My Gateway has Vista Home Premium 64 bit with SP1. Windows updates are not working at all.

After doing some digging I discovered Avast Anti-Virus may have deleted TrustedInstaller.exe which I believe may have something to do with the problem although TrustedInstaller.exe is still in C:/WINDOWS/services (which as far as I know is the correct location). Also, when I open Services (Start > Search "Services" > Services) and try to start the Windows Modules Installer It gives me the error:126 The specified module could not be found. This led me to belive that it may have something to do with my registry?

sfc /scannow also does not work.

Ive tried a number of fixes. One involved copying TrustedInstaller.exe from a friends computer to my C:/WINDOWS/Services

I have also consulted similar posts on this site sadly, to no avail. I tried installing SP2 hoping that would fix it, but without Windows Modules Installer working I could not get it to work.

I am willing to try anything short of reformatting. Restore is not an option as I dont have a restore point...

Any help you can provide with this would be greatly appreciated. Please explain in begginers terms any instructions you may have to fix this as I am little more than a beginner. Google is the only thing that got me this far :-)

Windows for home | Previous Windows versions | Install and upgrade

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2011-01-30T01:35:08+00:00

Ok folks quit your freakout...the answer exists and Google can find it. I fixed it on mine.

My symptoms:

  • Windows update fails
  • Manual install of service pack fails
  • sfc fails
  • Windows Modules Installer (aka TrustedInstaller) won't run and returns error 126
  • ...other stuff I can't remember fails
  • Errors like CO_E_SERVER_EXEC_FAILURE(0x80080005)

I read through a number of threads like this, here and on other sites. I tried the instructions above to no avail (although I can't be sure they weren't part of the solution). Then I found this:

http://www.vistax64.com/tutorials/282940-windows-modules-installer-error-126-fix.html

There is much detail there, written in broken English, with screenshots provided. Here is what worked for me, partially copypasta and partially paraphrased for brevity and clarity:

I was missing the following registry key: 

HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\Version.

To fix it:

  1. Navigate to C:\Windows\Servicing\Version and read the name of a subfolder. It will be named something like 6.1.7600.16385. That is your {TrustedInstaller ID}. Copy the name of that folder to the clipboard (and paste it in Notepad for safe keeping). 
  2. Find a subfolder in C:\Windows\WinSxS whose name starts with:

x86_microsoft-windows-servicingstack_31bf3856ad364e35_{TrustedInstaller ID} (32bit Windows)

amd64_microsoft-windows-servicingstack_31bf3856ad364e35_{TrustedInstaller ID} (64bit Windows)

Copy the name of that folder to the clipboard (and paste it in Notepad for safe keeping).

  1. Create subkey "HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\Version". You will need to take ownership of "Component Based Servicing" then give yourself full access permissions before you can create the key.
  2. In the new Version key, create an "expandable value" using the TrustedInstaller ID as its name and the complete path of the folder you identified in WinSxS as its value. Properly you should use %SystemRoot%\WinSxS\whatever instead of C:\Windows\WinSxS\whatever.

Was this answer helpful?

300+ people found this answer helpful.
0 comments No comments

64 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-07-10T07:01:37+00:00

    Ok folks quit your freakout...the answer exists and Google can find it. I fixed it on mine.

    My symptoms:

    • Windows update fails
    • Manual install of service pack fails
    • sfc fails
    • Windows Modules Installer (aka TrustedInstaller) won't run and returns error 126
    • ...other stuff I can't remember fails
    • Errors like CO_E_SERVER_EXEC_FAILURE(0x80080005)

    I read through a number of threads like this, here and on other sites. I tried the instructions above to no avail (although I can't be sure they weren't part of the solution). Then I found this:

    http://www.vistax64.com/tutorials/282940-windows-modules-installer-error-126-fix.html

    There is much detail there, written in broken English, with screenshots provided. Here is what worked for me, partially copypasta and partially paraphrased for brevity and clarity:

    I was missing the following registry key: 

    HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\Version.

    To fix it:

    1. Navigate to C:\Windows\Servicing\Version and read the name of a subfolder. It will be named something like 6.1.7600.16385. That is your {TrustedInstaller ID}. Copy the name of that folder to the clipboard (and paste it in Notepad for safe keeping). 
    2. Find a subfolder in C:\Windows\WinSxS whose name starts with:

    x86_microsoft-windows-servicingstack_31bf3856ad364e35_{TrustedInstaller ID} (32bit Windows)

    amd64_microsoft-windows-servicingstack_31bf3856ad364e35_{TrustedInstaller ID} (64bit Windows)

    Copy the name of that folder to the clipboard (and paste it in Notepad for safe keeping).

    1. Create subkey "HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\Version". You will need to take ownership of "Component Based Servicing" then give yourself full access permissions before you can create the key.
    2. In the new Version key, create an "expandable value" using the TrustedInstaller ID as its name and the complete path of the folder you identified in WinSxS as its value. Properly you should use %SystemRoot%\WinSxS\whatever instead of C:\Windows\WinSxS\whatever.

    can someone assist me with this please

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-05-24T20:00:20+00:00

    So, I have these exact same symptoms. I tried to ; 1) restart the Windows Update service 2) reboot machine 3) run SFC (errored out) 4) run chkdsk (no errors) 5) Run the WinRE repair image (Detected no errors) 6) Tried the fix that I am commenting on now. I have the exact reg key that this fix is for. I cannot determine the reasons for these errors.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-02-14T07:52:44+00:00

    I'm attempting to follow this step by step. However I am having problems with 'give yourself full access permissions before you can create the key.' I have attempted this several times, but receive the error 'Access denied' when trying to change the permissions. ~ How can I do this? Simply going to Permissions and changing it to 'Full Access' is not working. Thanks ~ Laura

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-01-27T16:02:02+00:00

    One thing I'd like to add...

    The registry for me had no problems. The key name and value were correct. I changed it to an older path, and it worked fine. I'm assuming, something happened to the latest files in that folder. So instead of amd64_microsoft-windows-servicingstack_31bf3856ad364e35_6.1.7601.23505, amd64_microsoft-windows-servicingstack_31bf3856ad364e35_6.1.7601.18766. Basically, this registry key is a pointer to a folder that contains necessary files for the service to function. Just point it to another folder until something works. Of course, those folders (in C:\Windows\winsxs) vary for each computer.

    Of course, this is a bit of a workaround. I'm not too sure why the current version is broken, or how to get a working replacement.

    Was this answer helpful?

    0 comments No comments