Questions tagged [servicecontroller]
104 questions
1
vote
2 answers
Service not found after installing using AssemblyInstaller
Context
Windows 2008 64 bit.
I have a .NET service installed that acts as an installer.
Background
I'm using this code (credit: Marc Gravell) to install a service:
using (var inst = new AssemblyInstaller(typeof(MyNamespace.Program).Assembly, new…

Ron Klein
- 9,178
- 9
- 55
- 88
0
votes
0 answers
serviceController return wrong status
ServiceController serviceController = null;
try
{
serviceController = new("name");
serviceController.Refresh();
if (serviceController.Status ==…

Ming Tong
- 105
- 1
- 8
0
votes
0 answers
Urllib to read response for internal service level call
My use case is to login to webapp and then hit internal network call and parse response to validate using Python 3.9
Sudo code :
login to web app. : Used selenium webdriver to login.
hit internal endpt using urllib, this needs login credential hence…

Janny
- 21
- 4
0
votes
1 answer
ServiceController Required Privileges
I'm using a ServiceController to Start services on a remote machine. When I want to query the services on that machine, I get the following exception:
Cannot open Service Control Manager on computer 'machinename'. This operation might require other…

crauscher
- 6,528
- 14
- 59
- 85
0
votes
1 answer
Not able to start and stop service from remote machine
We have some winodow services on the remote machine. I am not able to start and stop that services using service controller from my machine.

Denish
- 983
- 1
- 13
- 20
0
votes
0 answers
Windows 10 Service Start Error 2 (The system cannot find the path specified)
I am developing a kernel mode driver for Windows 10 and I am stuck on the service start it always gave me this error:
"0x2 The system cannot find the path specified"
to install it I have tried by the following ways:
Using "sc create svname…

Mov Eax
- 17
- 6
0
votes
1 answer
How to change the startup type of Windows service to Disabled programmatically in C#
Hi I'm trying to change the startup type of a existing Windows service. Say "Spooler" ( Print Spooler). I'm using ServiceController
var service = new ServiceController("Spooler");
service.Start();
…

SKN
- 520
- 1
- 5
- 20
0
votes
1 answer
Starting a service in ASP.NET/C# with the right permissions
on my website (written in ASP.NET/C#) I want the moderaters to be able to start a certain service. The code I have for this is:
ServiceController svcController = new ServiceController("InvidualFileConversion");
if (svcController != null)
…

Floris Devriendt
- 2,044
- 4
- 24
- 34
0
votes
1 answer
How to get answer from windows service
I´ve got a windows service and a NotifyIcon-Applicaiton (Sys-Tray) which should communicate with the service. The App should send a command and receive a PORT from the service for a socket which provides the further communication.
The Service…

Felix Arnold
- 839
- 7
- 35
0
votes
1 answer
'ServiceController' does not contain a definition for 'GetServices'
I what to list all services on my computer with a C# form APP.
But when i follow what all answers to list all services say i get:
'ServiceController' does not contain a definition for 'GetServices'
All my research leads to:
using…

ygdrazil
- 17
- 2
- 6
0
votes
0 answers
Is there a way to programatically find EventLogs and the Windows Services that generated them?
I'm using C# in Visual Studio 2019. I'm trying to get to list of all Windows Services currently on the system, which I successfully got, then get the EventLogs associated with those services, which I haven't been able to.
I'm able to get all…

Abdullah
- 133
- 1
- 2
- 10
0
votes
1 answer
sc.Pause() throws an exception
sc.Pause()
Try
While sc.Status = ServiceControllerStatus.Paused
Threading.Thread.Sleep(1000)
sc.Refresh()
End While
Catch ex As Exception
…
user10982370
0
votes
1 answer
Start and stop a windows service from normal user role
In My case, I have a WPF app which is responsible for user interactions to and there is a supporting windows service running behind.
I must execute the WPF app only in normal user privilege (non-administrator). Since the application has to start and…

jidh
- 172
- 1
- 6
- 22
0
votes
1 answer
WMI does not return expected service, ServiceController identifies OK
I'm trying to identify if a certain service on a remote PC is running or not and identify its start up type.
Using ServiceController I can successfully see the expected service on the remote machine but when switching to use WMI to drill deeper this…

Ben R
- 85
- 6
0
votes
0 answers
Change service start type on a remote machine
I can get the current start type of a service on a remote machine but I cannot change it. The ServiceController.StartType property is read-only.
Imports System.ServiceProcess
Dim myController As ServiceController
myController = New…

Ruben_PH
- 1,692
- 7
- 25
- 42