Menu ▼


Installing windows service using sc.exe in windows command prompt

To install windows service using sc.exe in windows command prompt follow the below steps

To create service:
  • Open windows command prompt as run as administrator
  • Type sc.exe create SERVICE NAME binpath= "SERVICE FULL PATH"
  • don't give space in SERVICE NAME
  • After binpath= and before " space should be there.
  • in SERVICE FULL PATH give the service exe file full path.
  • Example:
    sc.exe create ExampleService binPath= "F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe"
To delete service:
  • Open windows command prompt as run as administrator
  • Type sc.exe delete SERVICE NAME
  • Example:
    sc.exe delete ExampleService





comments powered by Disqus


Search dotnetlearners.com