Re: How to remote start/stop services using windows API?
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 08 Nov 2007 09:09:17 -0500
That isn't what the question seemed to say. This is now much clearer..
It is risky to use the service key name because this could be localized, but it should
work.
But as far as I can tell, OpenSCMManager needs only the machine name and the desired
access (the rights are checked against the currently-logged-in user).
What errors did you see, and from which API? Did it fail to open? Did OpenService fail?
What rights had you asked for in OpenService? and so on.
Without knowing the errors you are seeing, it is hard to tell exactly that the correct
approach might be.
joe
On Wed, 7 Nov 2007 18:34:01 -0800, Tom Lee <Tom.Lee@xxxxxxxxxxxxxxxx> wrote:
It seems you don't understand my question at all. I am trying to explain toJoseph M. Newcomer [MVP]
you... Hope you could understand it.
We could use the following APIs to start a service process remotely:
OpenSCManager()
GetServiceKeyName()
OpenService()
QueryServiceStatusEx()
ControlServiceEx()
StartService()
CloseServiceHandle()
But we could not use these APIs to get the remote user handle/credential, we
must need another function to do it. WNetAddConnetion2 could be used to get
the remote user credential, but it will fail in some cases. So I am searching
another way to do it.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Re: How to remote start/stop services using windows API?
- From: Joseph M . Newcomer
- Re: How to remote start/stop services using windows API?
- From: Tom Lee
- Re: How to remote start/stop services using windows API?
- Prev by Date: Re: IPC resource access counting problem
- Next by Date: Re: assert in atlsimpstr.h
- Previous by thread: Re: How to remote start/stop services using windows API?
- Next by thread: Re: How to remote start/stop services using windows API?
- Index(es):