Start/Stop windows services?

If you have a question or need help, this is the place to be.
Post Reply
PrinceCh
Posts: 1
Joined: Mon Aug 03, 2020 1:07 pm

Start/Stop windows services?

Post by PrinceCh » Mon Aug 03, 2020 1:11 pm

Hi,
Is it possible to start/stop windows services?
Regards.

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Start/Stop windows services?

Post by kgschlosser » Tue Aug 04, 2020 4:46 am

With EG anything is possible!!!

But to answer your question, Yes you can start and stop services.


To get the exact service name of the service you want to start and stop you can run this command from a command prompt

Code: Select all

sc query
create a macro and in that macro add in the System - > Run Command action. in the command line field enter one of the commands below you will replace SERVICE_NAME with the name you got from the query. make sure "Disable parsing of string" is checked off. Depending on on long it takes for the service to start or terminate and also what you are doing that may rely on the service you may or may not want to check off the "Wait until command is terminated before proceeding" If the service takes longer then 3 seconds to either start or stop I would recommend unchecking the wait and checking off the Trigger event. if there are additional actions that you would need to run after the service starts you can do that off of the event that gets triggered from this action.

Code: Select all

sc start SERVICE_NAME

Code: Select all

sc stop SERVICE_NAME
The user account that you are logged in with is going to have to have the permissions needed to start and stop services. Or you will have to run EventGhost as the Administrator.
If you like the work I have been doing then feel free to Image

Roosje
Posts: 1
Joined: Tue Aug 04, 2020 12:51 pm

Re: Start/Stop windows services?

Post by Roosje » Tue Aug 04, 2020 1:07 pm

It is quite easy to start or stop windows services. A service is an application type that runs in the system background without any user interface, and without needing a user to log in to the PC. Here is a very simple way of starting, stopping or disabling actions for services on local and remote computers.
1. Open the Services snap-in window.
2.Then you Start, Stop, or Disable any service you want to change its action. To start a service, right-click on it, and then click Start.
3.You can manage a program Startup type by double-clicking on it.
Roosje

User avatar
kgschlosser
Site Admin
Posts: 5498
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Start/Stop windows services?

Post by kgschlosser » Tue Aug 04, 2020 4:06 pm

@Roosje

I believe the person was asking because they wanted to do it programmatically
If you like the work I have been doing then feel free to Image

Post Reply