title: How to get physical path knowing the path to the exe file?
body: <p>How can I get the physical path to an item if I know path of the <code>.exe</code> file?</p>
  
  <p>Example: </p>
  
  <pre><code>$path = (Get-WmiObject -query "SELECT PathName FROM Win32_Service WHERE Name = 'Name of Service'").PathName
  
  cd $path #and this command not work because $path return path with service name 
  </code></pre>