Working with windows service

Steps to make a windows service work:

  • Create the windows service as usual.
  • Build the service.
  • Goto command prompt and install the .exe file of the service(present inside the debug folder) using the sc command.
    • sc create [ServiceName] binpath= [exe file path]
  • Goto services -> right click onĀ [ServiceName] and click start.
  • To delete the service the command is
    • sc delete [ServiceName]

Important Note: There is no need to create a separate setup file for this.