Hi,
Thank you for your reply.
Actually I've started using ServiceController class. However I can't
even access a service on my own machine... Here's what I do:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ServiceController1.Start()
End Sub
and
Me.ServiceController1.MachineName = "seoul"
Me.ServiceController1.ServiceName = "SMemory"
The error message I get is : Cannot start service SMemory on computer
'seoul'.
Any idea what I'm doing wrong ?
Spam Catcher wrote:
"graphicsxp" <sa*************@googlemail.comwrote in
news:11**********************@i42g2000cwa.googlegr oups.com:
Hi,
I've written a windows service in vb.net, which works very well. The
service is installed on my server, but now I would like to be able to
start/stop it from any machine on the network.
I know the command sc.exe but unfortunately it does not prompt for
Username/Password, and those are required otherwise I'll always get the
message 'Access denied'. Unless I can bypass authentication to start a
windows service ?
You can use the ServiceController class in .NET to start/stop services
remotely.
Or you can do it via WMI.
Or you could build a remoting interface.
So there are several ways to do it :)