title: Find the full path of process
body: <p>I have written the c# console application. when i lauch the application (<strong>not using cmd</strong>). i can see it is listed in process list in task manager ,now i need to write another application in which i need to find whether previous application is running or not ,i know the application name and path so i have written management object searcher query to get the list of process and also i am using the path to compare it with its executable path ,code is given below</p>
  
  <pre><code>            var  name="test.exe"
              var path="D:\test"
              var processCollection = new ManagementObjectSearcher("SELECT * " + "FROM Win32_Process " + "WHERE Name='" + name + "'").Get();
  
              if (processCollection.Count &gt; 0)
              {
                  foreach(var process in processCollection)
                  {
                      var executablePath=process["ExecutablePath"];
                      if(executablePath.equals(path))
                      {
                          return true;
                      }
                  }
              }
  </code></pre>
  
  <p>but executable path is always null.</p>
  
  <p>how to get its executable path?.</p>
  
  <p>I can not only use process name because i am using common name like startserver and stopserver to my application. so i need to ensure it executable path. </p>