title: How to create a service running a .exe file on Windows 2012 Server?
body: <p>I have created .exe in .net and want to use as a service, run all time on my local machine. I am using windows server 2012. how to setup a service on my local computer.</p>
  
  <p>**You can use windows shell script for create service with commands **</p>
  
  <p>The sc create command performs the operations of the CreateService API function.</p>
  
  <p>Here's what to do ...</p>
  
  <ol>
  <li><p>copy the "yourapplication.exe " to a suitable location on your
  Win2012 server (e.g. C:\Windows\System32\ ).</p></li>
  <li><p>Use "sc " to create a new service that launches "srvany " (e.g. sc
  create "Servicename" binPath= "C:'Windows'System32'srvany.exe"
  DisplayName= "My Custom Service" )</p></li>
  <li><p>Using RegEdit : create a "Parameters " key for your service (e.g.
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Servicename\Paramaters)</p></li>
  <li><p>Using RegEdit : within the newly created "Parameters " key , create
  a string value called "Application " and enter the full path to the
  application you are wanting to run as a service.  (No quotes
  required.)</p></li>
  </ol>
  
  <p>Syntax:-</p>
  
  <blockquote>
    <p>sc [] create [] [type= {own | share | kernel | filesys | rec | interact type= {own | share}}] [start= {boot | system | auto | demand | disabled}] [error= {normal | severe | critical | ignore}] [binpath= ] [group= ] [tag= {yes | no}] [depend= ] [obj= { | }] [displayname= ] [password= ]</p>
  </blockquote>
  
  <p><a href="http://technet.microsoft.com/en-us/library/cc990289.aspx" rel="noreferrer">More...</a></p>