Installing windows service


We can install windows service in multiple ways, here we will see one of the simplest way.

  • Open command prompt in run as administrator mode
  • Type the install command like below and click enter
    sc.exe create servicename binpath= "servicepath"

    Example:
    sc.exe create ExampleService binPath= "F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe"

    install

  • Now open the services list to see the installed service

    service list

  • To delete or install type the below command and click enter
    sc.exe delete servicename

    Example:
    sc.exe delete ExampleService