title: c# ManagementObjectSearcher used for finding process (and its description) with PID
body: <p>Im working on a program which should list me processes and when i click on certain process it should give me its description.</p>
  
  <p>My idea(Actually i modified something similar what i found on web) was to use ManagementObjectSearcher with sql statement ("Select * From Win32_Process WHERE ProcessID="+a); where "a" is string variable which contains process ID.For some processes its working(chrome,calculator for example) and for some it doesnt(svchost,tiltweelmouse and so on).</p>
  
  <pre><code>    private void Lista_procesa_prikaz_MouseClick(object sender, MouseEventArgs e)
      {
          string a = Lista_procesa_prikaz.Items[Lista_procesa_prikaz.FocusedItem.Index].SubItems[1].Text;
          var searcher = new ManagementObjectSearcher("Select * From Win32_Process WHERE ProcessID="+a);
          var proces = searcher.Get();
          foreach (var process in proces)
          {
              var processName = process["Name"];
              var processPath = process["ExecutablePath"];
  
              if (processPath != null)
              {
                  var fileVersionInfo = FileVersionInfo.GetVersionInfo(processPath.ToString());
                  var processDescription = fileVersionInfo.FileDescription;
                  Description_textbox.Text = processDescription.ToString();
              }
         }
      }
  </code></pre>
  
  <p>IF someone could spot mistake here i would be really happy,
  Any help is appreciated </p>
  
  <p>Thank you</p>
  
  <p>EDIT: Partially solved problem,if anyone even cares,platform need to be set to x64(in my case).Go to <strong>Project</strong>,<em>yourProjectName</em> <strong>properties</strong>,<strong>build</strong>,<strong>platform target</strong>:x64</p>