Friday, 20 March 2015

Pin It

Widgets

How to create, start, stop and delete a Windows Service using SC commands

1) First go to the directory where the Windows Service executable (.exe file) is present.

2) Open Command Prompt.

3) To create service, enter the following command:

sc create DemoServiceName binpath= "C:\Users\Arjun\Documents\Visual Studio 2013\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe"

where,  DemoServiceName = name of the windows service


4) Click Start button, type services.msc and hit enter. You can see the service DemoServiceName  in the list.



5) To start service, enter the following command :

sc start DemoServiceName




6) To stopservice, enter the following command :

sc stop DemoServiceName



7) To delete service, enter the following command :

sc delete DemoServiceName



No comments: