I\'m getting this error when I try to start a windows service I\'ve created in C#:
My Code
Computer -> Manage -> Service -> [your service] properties. Then the the tab with the account information. Play with those settings, like run the service with administrator account or so.
That did it for me.
EDIT:
What also can be the problem is that, most services are run as LOCAL SERVICE
or LOCAL SYSTEM
accounts. Now when you run C:/my-admin-dir/service.exe
with those accounts but they are not allowed to execute anything in that directory, you will get error 5
. So locate the executable of the service, RMB the directory -> Properties -> Security and make sure that the account the service is run with, is in the list of users that are alloewd to have full control over the directory.