Re: Vista - Starting a Service
- From: "Phil Wilson" <phil.wilson@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 Mar 2009 12:56:41 -0700
Unless you are explicitly elevated you won't have the permission. The
Services applet asks for elevation, right? Your program needs a manifest to
request elevation to Administrator because otherwise you'll be running
limited (unless you start from an elevated prompt).
--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972
"Smurfman-MSDN" <SmurfmanMSDN@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F61932AE-1340-4848-8398-A6DD08EF9B56@xxxxxxxxxxxxxxxx
Using VB2008 and Vista Ultimate x64
I have an application I have written that is two part - one is a Windows
Service the other is an interface for the settings for that service.
On my XP machine the service installs just fine and the following code
works
just fine:
Me.Interface_ServiceController = New
System.ServiceProcess.ServiceController
With Me.Interface_ServiceController
.ServiceName = ServiceNameIn
.Start()
End With
ServiceNameIn is defined as a String being passed to my function. If the
service starts the function returns True if not it returns false.
One XP I am able to start the serice from my interface with no issue.
In Vista I am getting an error:
Cannot open XYZService on computer '.'
Here is what I tried.
Net Start XYZService from a CMD prompt - I get an Error 5 Access Denied.
Verified that the service is set to manual run.
Manually starting the service from Service.MSC - works just fine.
I thought Originally the service name was screwing it up - "X Y Z Service"
so I renamed the service to XYZService with a different Display name.
This
did not matter.
I tried to define a machineName this too did not matter.
I am back to the permissions thing. Is there something in Vista that is
blocking my ability to programatically start this service?
Interestingly, I can query the service and I can get the status of it
either
running or stopped.
Any suggestions?
J
.
- References:
- Vista - Starting a Service
- From: Smurfman-MSDN
- Vista - Starting a Service
- Prev by Date: RE: Vista - Starting a Service
- Next by Date: Re: Vista - Starting a Service
- Previous by thread: Re: Vista - Starting a Service
- Next by thread: Re: Vista - Starting a Service
- Index(es):