CreateMutex failed in CGlobalMutex constructor [Windows Err Num: 5 (0x5): Access is denied.]

I have a server task which normally runs fron the notes.ini file on startup of Domino. If Domino is running as an application you can also run the executable from the DOS prompt and it will start up fine or be loaded from the the Domino server console fine. But if you start Domino as a service and then try to run the executable from the DOS prompt I get the error:

CreateMutex failed in CGlobalMutex constructor [Windows Err Num: 5 (0x5): Access is denied.]

Inside the NSD it says Access_Violation on the fatal_error thread. I have a good idea of what is wrong. The task is being started like any normal application and as the user whereas the Domino server is running as a service which is lower level.

What should I look for to correct this issue? I have tried started the many Domino server task like SMTP and HTTP with the server running as a service and they work fine so I know it is possible. Domino running as a service has not been around but too long. Is there a document anywhere that discusses methods of insuring code can work when Domino is ran as a service as well as an application?

Thank you.