Problem in starting custom NT service


We have written a VC++ code to start a java program as an NT service.  (NT 4.0 Service pack 5.0)

But  when we are starting the service we are encountering Dr.Watson error  (access violation).  

It seems that, while installing and/or running the service the user (as which I have logged in ) needs to belong to some user groups like administrator, power user etc.

We shall be glad if you can throw somelight on the various previliges / rights a user needs for installing and/or starting a custom NT service.
(Settings for NT service etc.)

Thanks in advance.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You need to give the "System Account" access (RWX) to any service folders or files.  What I mean is, if you have a service, the "System Account" is what must have Read, Write and Execute access to it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
v_sripadaAuthor Commented:
Thanks for your reply. Being a novice, I am afraid I have not understood it completely.

You mean that I need to set System Account access to the Files / folders used for installation / start/stop of the service?

How do I set the system account to have read, write and execute access??

Can I get a more detailed reply please.

I am using 2 exe files (along with one java.exe) for installing the service. Only one folder contains the required files for running the service.

First of all, my assumptions;

1) The folder your program is in is on an NTFS formatted drive.

2) The program is already setup as a service.

3) The "Log On" is the Local System Account.

The folder must have the security setup so that the Local System Account has at least Read/Execute ability.

Or, you can have the "Log On" set to another account that does have the Read/Execute ability.  If you do it this way, it will not interact with the desktop.  This is done using "Control Panel", "Services", "'your service' Properties".  Then you select the "Log On" tab and you can see what I mean.

You can also put your program in the "WINNT\System32" folder and run it from there.  I don't like this method.
v_sripadaAuthor Commented:

Thanks for your reply. Sorry I am dragging this query for long. But I think I should tell the complete story.

We are always logging as administrator  and the log on is always system account for the service.

1. We have installed the service successfully.

2. When we are trying to start the service, on some machines it worked fine and on some other machines it was giving Dr.Watson access violation error. Then we made the administrator belong to all other groups like power users, backup operators etc. then it worked fine (May sound stupid, but it worked)

3. Now on some machines it is giving error no 2186, while starting the service. (That is unable to start the service error message).  We think that this error is occuring on machines which has processors that belong to before pentium era.

This is the story and coming to setting the read/execute ability for the folder,
1. Is it needed for even "system account"?
2. If so, how do I set this ability for a folder for this account??  I followed the steps given in windows help, but the security tab that is talking about is not to be found on my m/c.
Could u tell me in detail how to set it.

You can use my e-mail id :

Thanks once again.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.