I have portable version of an app. I have ran for example 5 multiple instances of it and they all have the same process name but different pids. I want to find a way to for example kill one specific process, cause using taskkill with the name of that process would kill all of those. I want to kill just the specific one by providing the pid of that process.
Now the question is: How can I find a process pid so that I can use this number to kill that specific application easily?
For example I want to kill the third one (I mean by using time).
Can pid gives me information of when a process was ran? If not What are the other workarounds?
Windows – How to find process pid of an application
batchpidprocesswindows 7
Best Answer
The multiple instances all have different PIDs as you've stated, so why do you need to change them? Just use TaskKill to kill on the basis of specific PIDs instead of the process name. From
TaskKill /?
:Edit: Here's a batch file that figures out the PID of the program instance it launched and thus can naturally be extended to kill that instance using TaskKill if so required: