When using sc create ServiceName binPath= "the path", ... windows-services ... Here is an example:
stackoverflow.com