This source works fine but now I need to modify it.

It kills a single instance, but now there are two instances of bartshel.exe with each having their own P.I.D. that I need to kill.

I can write it to have it run twice with a delay in between.

I am going to read up some and see if processes can be killed using P.I.D. if they are the same each time a program runs.

Thanks,
          Andy

Attachments:
Posted on 2009-07-30 13:34:38 by skywalker
Use OpenProcess to get a handle from the PID and terminate the process using the returned handle. Be sure to specify the proper permissions when opening the process (you will need at least PROCESS_TERMINATE)
Posted on 2009-08-04 08:21:37 by donkey
Here is a code sniplett


                    invoke TerminateProcess, hProcess, 0
                    invoke CloseHandle, hProcess ; fails if eax is zero
                   
                    mov bResult,TRUE;
                .break ; added 7:58:34 AM Tuesday, May 29, 2007

the .break maco exits the loop so as soon as it finds the target file it will stop looking for more.  Comment out that line and see what happens
Posted on 2009-08-04 19:50:35 by GoldStar611

Use OpenProcess to get a handle from the PID and terminate the process using the returned handle. Be sure to specify the proper permissions when opening the process (you will need at least PROCESS_TERMINATE)


I got the program to work properly.

Andy
Posted on 2009-08-04 20:36:02 by skywalker

Here is a code sniplett


                    invoke TerminateProcess, hProcess, 0
                    invoke CloseHandle, hProcess ; fails if eax is zero
                   
                    mov bResult,TRUE;
                 .break ; added 7:58:34 AM Tuesday, May 29, 2007


Thanks, that did the trick.

Andy
Posted on 2009-08-04 20:37:24 by skywalker