title: Access denied while getting process path
body: <p>I am trying to get process path by pid but I'm getting Win32Exception (access id denied).</p>
  <p>The code looks like this:</p>
  <pre><code>string path = Process.GetProcessById(pid).MainModule.FileName
  </code></pre>
  <p>I have tried using OpenProcess with GetModuleFileNameEx but OpenProcess is returning 0. I even tried enabling SeDebugPrivilege according to <a href="http://rongchaua.net/blog/c-how-to-enable-sedebugprivilege/" rel="noreferrer">C# – How to enable SeDebugPrivilege</a> but it didn't help.</p>
  <p>The above code works for most of the processes but throws error for SynTPHelper.exe (Synaptics Pointing Device Helper) The application is running under the same username as my code. Both, my application and the process run in 64 bit.</p>
  <p>Is it possible to retrieve the path <strong>without</strong> running my application as an administrator?</p>
  <p><strong>Edit</strong></p>
  <p>Task Manager is able to 'open file location' even though I'm not running it as an administrator.</p>