views:

30

answers:

2

Hello,

I have a process that is created on windows machine (Lets call it PRS). The amount can be different amount. The processes are created by a nother process (Manager) which is defined as a service. the Manager get instructions and reacts according to the request (for example creating a new PRS, stopping PRS etc'). When creating (using the MANAGER) a few applications PRSs evey one of the get also parameter of which ini file to create(every ini is uniq and has an ID that represent it). When creating 2 processes PRS (eveyone is passed uniq ini file) I can see them using the TASK-MANAGER with the same name.

My problem is that I need to write a script that gets the list of ID that represents the process and terminate it. I am writing it in java script. Is there a way of dicovering according the ID that I gave as parameter when I created the process which one I need to terminate ?

Thnaks

A: 

You can't recognize the PID of a process according to parameters you gave it. You can use another process for getting the PID of the process or using files for have that information.

Roman Dorevich
A: 

Roman is right. Also it's not a good practice to terminate your process. Try to use interprocess communication. Here some links: msdn or codeproject or try google.

Igor