title: Get service path from services.msc c#
body: <p>I'm trying to get service executable path from services.msc</p>
  
  <p>I wrote the next code:</p>
  
  <pre><code>  var service = ServiceController.GetServices().Where(p =&gt; p.ServiceName.Equals("Service name", StringComparison.InvariantCultureIgnoreCase));
  if (service.Any())
  //get service data
  </code></pre>
  
  <p>I couldn`t find where (if at all) the service executable path is located?</p>
  
  <p>In services.msc I can see the path so I'm assuming it also possible to get it through code.
  <img src="https://i.stack.imgur.com/hTRBA.png" alt="Example of service info in services.msc (see that executable path exists there)"></p>
  
  <p>Any Ideas?</p>