I am trying to create a service in windows using sc.exe to connect jenkins slave to master using swarm jar file.
I use the below command to create the service.
sc create jenkins-slave binPath= "java -jar C:\swarm-client-3.3.jar -master jenkins_master_url -username myuser -password mypass" start= auto
But when I start the service, it is giving me an error the system can not find the file specified.
I tried to put whole command in a batch file and tried to create the service but no luck. My doubt is whether we can pass arguments to the executable at all. If not is there any other better way ?
Any help on this will be appreciated.