Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • That is not possible under windows (and i don't think its possible under linux and unix either), but you can get and kill windows filtering by process name, main window handler, window class and some other methods.
    – Felype
    Commented Apr 25, 2015 at 21:14
  • 1
    You are asking the wrong question. Since the instances already have different PIDs (as you've yourself stated), there's no need to change these PIDs when you just want to kill certain instances. See my answer below.
    – Karan
    Commented Apr 25, 2015 at 21:18
  • @Karan Lets make this interesting. Assume I want to do this from a batch file (automate things and schedule them) and I dont know what is the pid of that process (and again there are multiple instances with same names).
    – user441228
    Commented Apr 26, 2015 at 21:26
  • 2
    Perhaps the question you should be asking is "When I start an application (e.g., from a batch file), how can the batch script learn the PID of the application process, so it can use it later to kill the process?"  (The answer might be: run tasklist with output to a file before and after starting the application, then compare the output files to see what PID is in the second file but not the first.)  Or perhaps, "Given multiple Windows processes, how can I distinguish among them (e.g., by start time or other discriminators)?" Commented Apr 27, 2015 at 4:11
  • Also, (1) You might want to tag your question with [windows] (ideally, specifying the exact version that you're using) and [batch], because, until you edited the question, there was no way to tell that you weren't talking about Unix.  Also, (2) I don't understand what you mean by "I have an application installed on my computer ... and I have the portable version of that too."  If that's important to your question, you might want to reword it. Commented Apr 27, 2015 at 4:12