Fixing Error 5: Access Denied when Starting a Windows Service

After creating your own Windows Service, you may encounter the following error:

Sounds serious, but it’s not. It’s complaining that executable can’t be started because the account under which the service is running does not have access. When you installed the Windows Service, you had to choose a context like Local System, Local User, Network User, or something custom. In order to fix this issue, you need to give execute permissions to the user you chose. For example, NETWORK SERVICE account may need permission if that’s the context you chose to run the service.

Even after that hard work, you might still see an error like below:

This is a more generic error which indicates that something threw an exception during the OnStart method of the service. Since it’s so generic, there’s not really one solution to the problem. You need to check the Application Log in the Windows Event Viewer to understand what faulted the service. In some cases, it could be a bad application configuration (as one example).

Add a comment

Your email address will not be published.


  1. d Agee

    Can’t start the windows search service. Auto start doesn’t work, manual start doesn’t work. You get the error5 message if you try to start it. I am admin, and the only one on the machine. I tried admin command prompt w net start. You get the same permission error. Tried admin command prompt to start services.msc and start from there. No luck. There has to be some way to start the service, this windows is so stupid. Maybe next time I will switch to Apple.

    thanks for any help anyone can offer.

  2. rick

    You post has been the most informative so far on the Error 5 Access Denied issue. Although I still have not been able to solve it for Windows 10. I have tried Local System, I even tried my own account (admin, owner of the entire directory), and I still get this error. I can run the exe myself if I click it, but who wants to do that, when computers can automate stuff like this that should be auto started.