title: How to verify whether service exists in Services.msc
body: <p>I am using following code to get the path of the service...</p>
  
  <pre><code> string ServicePath = string.Format("Win32_Service.Name=\"{0}\"", "MyService");
   var WMiObject = new ManagementObject(ServicePath);
   string PathName = (string)WMiObject.GetPropertyValue("PathName");
  </code></pre>
  
  <p>Now if the service is not available then the call wmiObject.getPropertyValue("PathName")
  will throw the ManagementException..</p>
  
  <p>In my case i need to assign the HardCoded path if the service is not available..
  How to achieve that??
  Please guide...</p>