Remote Desktop Service Error 126 Module not found

When you attempt to start the Remote Desktop Services (“TermService”) service, Error 126 may occur. Here’s the complete error message:

Windows could not start the Remote Desktop Services service on Local Computer.

Error 126: The specified module could not be found.

remote desktop service error 126

Cause

The error occurs if the file termsrv.dll is missing or corrupted. Another reason could be that the Remote Desktop Services ServiceDLL may be pointing to a third-party module, such as “%ProgramFiles%\RDP Wrapper\rdpwrap.dll” (“RDP Wrapper.”)

The RDP Wrapper’s .msi file is broken. It doesn’t install or uninstall the app correctly. The following error is shown:

There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.

RDP Wrapper install error

As a result, the uninstallation procedure is not proper. The entry remains in the program listing.

RDP Wrapper install error

Resolution

To resolve the Remote Desktop Services (“TermService”) service error 126, follow one of the methods below:



Option 1: Uninstall “RDP Wrapper” properly

  1. Download the RDP Wrapper setup .zip file from the following link:
    https://github.com/stascorp/rdpwrap/releases
  2. Unzip and extract the archive to a folder.

    RDP Wrapper cleanly uninstall

  3. Run Uninstall.bat, and click Yes when asked for elevation consent.
  4. Download MicrosoftProgram_Install_and_Uninstall.meta.diagcab from Microsoft. (Source: Microsoft.)

    (If Microsoft Edge or Chrome mislabels the above file as PUA/malware, choose to keep it by tapping “” in the bottom bar, choosing Keep, and then choosing Keep anyway in the dialog that appears.)

  5. Run the .diagcab file you downloaded. Click Next.

    microsoft program install uninstall troubleshooter

  6. In the next screen, click “Uninstalling”.

    microsoft program install uninstall troubleshooter

  7. Select “RDP Wrapper Library”, and click Next.

    rdp wrapper clean uninstall using diagcab

  8. Click Yes, try uninstall.

    rdp wrapper clean uninstall using diagcab

    This cleanly uninstalls “RDP Wrapper” and restores the original ServiceDLL entry in the registry.

  9. To delete the “RDP Wrapper” entry in Apps & Features or Programs and Features, open an admin Command Prompt, and run this command:
    reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{37EA5771-3352-4A52-9FAC-9297331DAEBD}" /f

    Press Enter.

  10. Restart Windows.

That’s it. Remote Desktop Services should now start correctly.


Option 2: Fix the ServiceDLL registry entry manually

  1. Open Regedit.exe and go to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService\Parameters
  2. Double-click ServiceDll
  3. Set its data to %SystemRoot%\System32\termsrv.dll
    (Also, ensure that the value type is REG_EXPAND_SZ instead of REG_SZ.)remote desktop service error 126
  4. Exit the Registry Editor.

Check if termsrv.dll exists

Additionally, make sure that the module termsrv.dll exists in the C:\Windows\System32 directory.

You may check the integrity of the file by running the following command from an elevated Command Prompt:

sfc /scanfile=C:\Windows\System32\termsrv.dll

If the above file is missing and Sfc cannot repair it, run the Dism command. Alternatively, you can restore the missing file from WinBIndex.

One of the above steps should take care of the issue.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time.

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a ten-time recipient of the Microsoft MVP award in Windows Desktop Experience (Windows Shell), from 2003 to 2012. Ramesh founded Winhelponline.com in 2005.

6 thoughts on “Remote Desktop Service Error 126 Module not found”

  1. Thanks so much for this! I had installed rdpwrap a long time ago, and recently my antivirus deleted it, so your regedit fix was the exact solution I needed.

    Reply
  2. Thanks! Saved me as well.
    Same as @Kyle, Antivirus deleted rdpwrap.dll but the TermService (RD Host) still pointed to it and made the service un-launchable. I tried:
    DISM from Windows Update (No offline source)
    DISM from Offline source (mounted install.wim of same version and edition of Windows)
    sfc /scannow
    over SSH, none of which succeeded in fixing it. Having suspected it would be something around the service configuration, and placing high confidence that the ServiceDll pointing to “%ProgramFiles%\RDP Wrapper\rdpwrap.dll” was the culprit, I enabled remote registry to remotely view the service in regedit but had no non RDPWrapped systems to use as a reference…
    This niche little article couldn’t be more of a lifesaver!

    Reply
  3. Thank you so much for this article, it saved me a huge amount of time. This is what I was looking for when faced ‘module missing error’ but didn’t find this anywhere online. Thanks a ton.

    Reply

Leave a Comment