title: How to setup Jenkins Slave to run as a windows service using command line?
body: <p>I want to create a jenkins slave using command line. The is a <a href="https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=66847778" rel="noreferrer">document</a> about setting up jenkins slave as a windows service and I followed the instruction there. I can run <code>javaws http://10.121.33.4:8080/computer/Test-Jenkins-Slave-2/slave-agent.jnlp</code> to connect slave to master but the problem of this is it will get disconnect after the machine is restarted.</p>
  
  <p>I think the best way to do this is to install slave as a service. So, I tried to follow the instruction again on that page. I have jenkins Slave installed as a service and the registry key added like below.</p>
  
  <p><strong>Service's property:</strong><br>
  <img src="https://i.stack.imgur.com/IjJN5.png" alt="enter image description here"></p>
  
  <p><strong>Registry values:</strong><br>
  <img src="https://i.stack.imgur.com/T9sQE.png" alt="enter image description here"><img src="https://i.stack.imgur.com/4DaWl.png" alt="enter image description here"></p>
  
  <p>I wonder if I did anything incorrectly? Is the document missing something?</p>