1. Hi there
    I can’t tell you how helpful this blog has been – I have been banging my head against this for a while now. Most sincere thanks – drinks are on me!


  2. For any other readers I should add that error messages of the form
    [125] Subsystem ‘XXX’ could not be loaded (reason: 126)

    are caused by the same issue.

    And you even wrote a script!!!

    Barry again

  3. Glad I could help !

    The script is because I had to fix a lot of instances and I didn’t want to bother finding out which ones to fix manually. So I rolled this script out over all our servers 🙂


  4. Thank you so much for the script.

    Just a one question, after executing the script problem fixed, but after
    restarting SQL Agent , opening also command line window from sqlagent90.exe and still to be opened.
    What can be the reason?
    thank you


  5. If I closing this window of Agent it restarting automatically and I get error at event viewer
    SQLServerAgent Monitor successfully restarted SQLServerAgent after SQLServerAgent terminated unexpectedly.


  6. Are you using services.msc or the configuration manager to start SQL agent ?


  7. services.msc

    and when i’m starting service SQL Agent, now also opening this window


  8. I have no idea why you would get a popup window when starting SQL Agent, it has never happened to me before, does it give any extra information in the agent log ?


  9. It’s a my mistake
    Parameter “Allow service to interact with desktop” on SQL Agent was checked

    🙂 Thank you again for the script !


  10. Ah that explains it, good luck !


  11. Many thanks to you for not only the explanation of the problem, but for the script as well! I have been fighting these “stored path” problems for the last few days, but when this one happened, I found your page and my problem was solved immediately!

    Thank you, thank you, thank you!

    Brandon M

  12. Hi,

    I am getting this

    [125] Subsystem ‘ActiveScripting’ could not be loaded (reason: The specified module could not be found)

    I used your script and executed. But when I restart the sql server the error logs are giving the same error.


  13. Maybe your setup has something I didn’t account for in the script. Do a select on msdb.dbo.syssubsystems and look for the DLL files on your setup, then modify the path’s to the DLLs. Good luck !


  14. You are a genius. Thank you.


  15. Thanks !


  16. I moved MSDBs across instances as well…in hindsight it was a bit more trouble than it was worth. Your fix saved my butt. Thanks


  17. Great script and explanation–thanks a lot of saving a great deal of my time!

    Btw, this script works on SQL 2008 as well! I just commented out the IF check and ran rest of the script as it is. Of course, I thoroughly reviewed the script and verified that the logic would work before I went ahead with it 🙂


  18. Thanks, gret script, even does not make sense hat for a Disater Recovery scenario when is desirable to do a full restore, this information comes hardcoded in table…

    Federico Von

Comments are closed.