title: Create and start Windows 7 or 10 service using batch file?
body: <p>According to <a href="https://support.microsoft.com/en-us/help/137890/how-to-create-a-user-defined-service" rel="nofollow noreferrer">How to Create a User-Defined Service</a> you can create a Windows service using Windows NT Resource Kit. For example as shown in above link:</p>
  <pre><code>C:\Program Files\Resource Kit\Instsrv.exe Notepad C:\Program Files\Resource Kit\Srvany.exe
  </code></pre>
  <p>But this does not work in Windows 7 or 10 and 64bit platform for that matter because Windows NT Resource Kit is not available for newer Windows versions. I was able to create the Windows service using this batch file:</p>
  <pre><code>sc create &quot;MyService&quot; binPath= &quot;C:\Program Files (x86)\MyProg\myprog.exe&quot; start= auto DisplayName= &quot;My Service&quot; obj= LocalSystem
  </code></pre>
  <p>But it does not start the Windows service. When I try to start I get this message:</p>
  <p><img src="https://i.stack.imgur.com/tsvF4.png" alt="error message dialog" /></p>
  <blockquote>
  <p>Windows could not start the OrchestrateIT Import Service service on Local Computer.</p>
  <p>Error 1053: The service did not respond to the start or control request in a timely fashion.</p>
  </blockquote>
  <p>The information in <a href="https://stackoverflow.com/questions/8164859/install-a-windows-service-using-a-windows-command-prompt">Install a Windows service using a Windows command prompt?</a> and <a href="https://stackoverflow.com/questions/3582108/create-windows-service-from-executable">
  Create Windows service from executable</a> does not work.</p>
  <p>How to start the Windows service successfully?</p>