How to Get Process Path from PID on Windows
Windows Task Manager is a very useful utility built into the Windows operating system. It can be launched by a few different methods such as selecting “Start Task Manager” from the taskbar context menu, pressing Ctrl+Shift+Esc, running taskmgr.exe from the Start menu, and etc.
For computer beginners, Task Manager is mostly used to forcefully end a process that is not responding or hung. For advanced users, it can be used to look for suspicious running processes. The Task Manager has limited functionality in some areas by default. For instance, you cannot determine the program path for a running process because it only shows the image name and you’ll have to search the hard drive for the filename.
It is sometimes important to know the exact path to a running process because an executable can trick a user into thinking that it is a legitimate process by impersonating the filename, but located at a different path. Thankfully, Task Manager can do this with a few minor adjustments. Also, some third party task management software can also show the process path by default. Here we show you some options.
Windows 10, 11, and 8/8.1
The Task Manager in Windows 8 and newer operating systems shows fewer details by default than previously. However, it is reasonably powerful and able to show the path to the process in more than one location with a few mouse clicks. Click the “More details” button at the bottom to open the full Task Manager interface
The first method is to right click on the process in either the Task Manager Processes or Details tabs and select the “Open file location” option. That will launch Windows Explorer with the program’s path and the executable highlighted.
Alternatively, you can also select “Properties” to bring up the program’s properties window that shows the location and executable name of the program.
The second main method is able to show the path and name of all the programs in the main window. To do this in the Processes tab, right click on the column sort/selection bar and select the Command line option. Although this option will also show all the arguments used by the program when it was launched, it does show the full path of the program.
The Details tab also has a similar Command line column view, but it also has an extra option to show just the path and executable name without any additional arguments. Right click on the column sort/selection bar again and choose Select Columns. About three quarters the way down the list are the two options we are looking for. Command line does the same as before while “Image path name” will show just the path to the file.
Obviously, you only have to uncheck any of the options listed above to remove them from view again.
Windows 7 and Vista
A lot of improvements were made to Task Manager in Windows 7 and Vista over Windows XP. The ability to show the path and name of a running process is quite similar to the option found in the Windows 8/10/11 Task Manager Details tab.
While in the Processes tab, go to the View menu and click the “Select Columns” option. The “Image Path Name” checkbox is the most useful and it will simply show the path and executable name. The “Command Line” option will additionally show command line arguments that are used when the executable is launched.
Third Party Task Managers That Show Process Paths
As we mentioned above, with a few small changes it’s possible to view the executable file connected to the running process along with its path in Windows Task Manager. However, there are some third party file managers around that show these values by default and without any configuration changes. Here are a few to look at.
SterJo Task Manager
This file manager is actually very easy to use and is much simpler than the Windows version.
The full path to the process is front and center in the main window in the Path column. SterJo Task Manager has a portable version so it works quite well as a simple process path viewer.
Anvir Task Manager
Anvir actually is a polar opposite to SterJo Task Manager and is a very comprehensive and powerful task management tool.
The path to the process view is listed by default in the Processes tab under the “Executable File” column. Hovering over the process will also give a popup that lists other information such as the program command line and parent process. There is a paid version of Anvir but the portable free version works just fine for this purpose.
Download Anvir Task Manager Free
It’s fair to say that DTaskManager is probably somewhere in between SterJo and Anvir in terms of its features and functions.
Like the other tools listed, the path to each process is listed by default in the main window. It’s shown in the Path column. DTaskManager is portable and a handy alternative to Windows Task Manager for troubleshooting if you have virus or association issues.
Export List of Running Process Paths to Text File
While it’s very easy to get Windows Task Manager or a third party task manager to show the program path for the process, it’s more difficult if you want to export those paths to a text file list. Thankfully, it’s easily possible to direct output from internal Windows command line tools to a file.
There’s a few ways to get a list of running processes along with their paths using PowerShell. Note, make sure to run the PowerShell or Command Prompt console as administrator or you won’t get the full list of processes.
Get-Process | Select-Object -ExpandProperty Path | Out-File -FilePath C:\Users\Raymondcc\ProcessPath.txt
This first command is the simplest and will output a list of complete paths of running processes to a text file. Here’s another command for PowerShell.
Get-Process | Get-Item -erroraction silentlycontinue | Format-Table -autosize name,directory | Out-File -FilePath C:\Users\Raymondcc\ProcessPath.txt
The second command above is slightly different and will output a formatted table to a text file. The first column will be the process executable name, the second column will be the directory path to the executable. Note that if paths appear to be cut off, expand the PowerShell window width and try again.
This time, we’ll use Windows Command Prompt to send the process and path list to a file.
Wmic Process Get ExecutablePath >C:\Users\Raymondcc\ProcessPath.txt
Although using WMIC from Command Prompt is quicker than the PowerShell commands, it does have a formatting issue because there will likely be some blank lines in the text file. This is easily rectified if you have a text editor like NotePad++. Simply load the file and go to Edit > Line Operations > Remove empty lines (Containing blank characters).
NotePad++ is also useful for removing duplicate lines from the list of processes using any of the three methods above. This is because there will probably be multiple entries for executables like svchost.exe, chrome.exe, and etc. From the same Line Operations submenu as above, use the “Remove duplicate lines” option.
Great, now how do i do it with just my phone?
thanks ,,I too struggled along with the process,,,
Very useful post…Thanks Raymond.
simple, yet so useful! :)
I like it thanks
you certainly have a way with computers man…keep up the good work..
This is fantastic. Thank you very much. I had a case today where there is a program in the process list using 50% cpu and I wanted to to know where it was launched from. Thank you again
Another nice post on your count!!!
I knew that there had to be a way to find this information while not using a 3rd party program. After all, the OS developers had to use something and we all know how much XP is full of information (Bloat Ware). You just have to know where to find it.
Usually I use Process Explorer.
I run Process Explorer but this is still very useful to know.
Thx for the info.
Thanks for the nice tip!!
have a nice day
Thanks.. this is very useful
Nice Topic, Good Job
Awesome, never knew that. Thanks
Thanks a lot..
I was looking this possibility since a long time……
Thank you very much for the article.
Before, the same as you do, I’m search for the entire system drive to locate the running process.
I never know this before that you can use built in system information.
I used DTaskManager for this kind of task, and you can use this to replace task manager in windows XP.
good article , thx for the info.
Thanks for very useful tip. I also used to search the process name throughout the entire C drive and sometimes found that executable was running from D drive (malware). Your tip will help me better diagnose on XP platform.