Tuesday 5 May 2020

Installing windows service using sc.exe in windows command prompt

http://dotnetlearners.com/windowsservice/installing-windows-service-using-sc-exe-in-windows-command-prompt

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

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive