Service from c9 or higher?


#1

how to start and stop windows service from c9 or higher ??
and do not be by command of msdos

with administrator permissions


#2

I use SelfService from Capesoft and works like a charm

http://capesoft.com/accessories/SelfServicesp.htm


#3

I want to stop and turn on a windows service on demand


#4

Yes, SelfService not only allows you to create a service from one of your applications but if you dig into the code you can see the functionality for controlling a service (create, delete, start, stop, status, etc).
Without SelfService you can either look into the service APIs. Here’s a starting point: https://docs.microsoft.com/en-us/windows/desktop/api/Winsvc/nf-winsvc-controlservice
Or use the SC command line utility via RUN() or ShellExecute.


#5

Is doable and as Rick describes there’s a lot more you can do.


#6

Another option is creating a utility with Setupbuilder. But Self Service works well too.


#7

I do not need to create service… i need start/stop service of windows, for example “Service telefonia”, start when starting application, and stop when close application…


#8

Hi,

Take a look at Odd Job from CapeSoft.
I am sure it will be able to do it.
http://www.capesoft.com/accessories/OddJobsp.htm

Regards

Johan de Klerk


#9

Hi franky,

I think you are getting confused here.

What Rick and others are trying to tell you is that SelfService isn’t just for creating services but also has code to allow you to do exactly what you are asking for.

Take a look at the documentation here

You will see two methods specifically for your needs. StopService and StartSerice.


#10

yes, this is the easiest way, as simple as nail.