Finding Executable Path

by Mar 10, 2016

Here is a one liner telling you the exact location of the executable of any running process. The example returns the path to the PowerShell executable you are currently running:

 
PS> (Get-Process -Id $pid).Path 
C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe 
 

Use a different process ID, or search by name, to find other process executables as well. Or use Select-Object to list all top level applications that are currently running:

 
PS> Get-Process | Where-Object MainWindowHandle -ne 0 | Select-Object -Property Name, Description, Path

Name                 Description               Path                             
----                 -----------               ----                             
ApplicationFrameHost Application Frame Host    C:\WINDOWS\system32\Applicatio...
chrome               Google Chrome             C:\Program Files (x86)\Google\...
explorer             Windows-Explorer          C:\WINDOWS\explorer.exe          
Illustrator          Adobe Illustrator CC 2015 C:\Program Files\Adobe\Adobe I...
POWERPNT             Microsoft PowerPoint      C:\Program Files (x86)\Microso...
powershell_ise       Windows PowerShell ISE    C:\WINDOWS\system32\WindowsPow...
WINWORD              Microsoft Word            C:\Program Files (x86)\Microso... 
 

Twitter This Tip! ReTweet this Tip!