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
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
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)
Here is a code sniplett
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
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
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
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