Create a windows service from the command line

5 Jul

This is pretty useful to know:

sc create ServiceName binpath= c:\progra~1\folder\file.exe

If you get “[SC] Createservice Success” then you’ve got it right

You can then go into services.msc and set it to autostart and start it if you like.

PS, to delete a service, run:

sc delete ServiceName