Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

starting service from dll

Status
Not open for further replies.

jfisher

IS-IT--Management
May 3, 2001
3
JM
Hey does anyone know how to write a component running on a server to start and stop a component also running on the server? It shoul also know when the service is running or not i tried placing this in a batch file on the server:
net stop accsevice where 'accservice' is the service name I then installed a component on the server(from serverobjects.com) that runs an application with given parameters ASPEXEC "net start accservice" and "net stop accservice"
The funny thing is if the command would not be affecting the service's state ie starting it if it was already started or stopping it if it was not started then a message would be returned on stdio &quot;the <service name> is already started or has not been started. However if I was trying to start it for the first time I would get system error 5 Access Denied. I have a deadline to meet soon so could someone point me in the right direction?
email jafisher2000@hotmail.com
 
I sounds like you might have a permissions problem. Check to see if your component is a member of the administrators group, as only administrators can (usually) start/stop services.

Plan &quot;B&quot; might be to change the userid the service is running under to be the same as your component.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top