I have tried to use killproc to kill all processes with a name. Inevitably, it kills only one of them with that name. How can I make it kill them all?
Examples:my PC is running 4 programs. I want to use "KillProcDLL::KillProc" to kill all them,when i install/Uninstall.
about KillProcDLL::KillProc
13 posts
Perhaps it would be better to use this plugin:
Use the FindProcess function in a loop with KillProcess.
Stu
Use the FindProcess function in a loop with KillProcess.
Stu
Originally posted by Afrow UKsorry sir.
Perhaps it would be better to use this plugin:
Use the FindProcess function in a loop with KillProcess.
Stu
I don't konw how to write Use the FindProcess function in a loop with KillProcess.
Stu
loop:
Processes::FindProcess "process_name" ;without ".exe"
StrCmp $R0 1 0 done
Processes::KillProcess "process_name" ;without ".exe"
StrCmp $R0 1 loop
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "process_name could not be closed.$\r$\nTry again?" IDOK loop
Abort
done:
Originally posted by Afrow UKThank you sir
Stu
loop:
Processes::FindProcess "process_name" ;without ".exe"
StrCmp $R0 1 0 done
Processes::KillProcess "process_name" ;without ".exe"
StrCmp $R0 1 loop
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "process_name could not be closed.$\r$\nTry again?" IDOK loop
Abort
done:
BTW KillProcDLL also returns some value 🙂 To kill them all just use it in loop with "...check out $R0 to get the return value". Plug-in returns 0 if "Process was successfully terminated".
Ah yes 🙂
Stu
loop:
KillProcDLL::KillProc "process_name.exe"
StrCmp $R0 603 done
StrCmp $R0 0 loop
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "process_name could not be closed.$\r$\nTry again?" IDOK loop
Abort
done:
Hmmm... I was looking for a solution to a similar problem (killing a process before uninstalling (deleting) its .exe) and I luckily found this thread.
However, I am somewhat confused by the code you posted here:
First, the readme.txt that accompanies that plugin demonstrates getting the return code by first popping $R0:
Thanks,
Victor
However, I am somewhat confused by the code you posted here:
First, the readme.txt that accompanies that plugin demonstrates getting the return code by first popping $R0:
Processes::KillProcess "process_name"
Pop $R0
StrCmp $R0 "1" dead_meat why_wont_you_die
dead_meat:
...
why_wont_you_die:
... However, I tested the code with using the statement Pop $R0 and it seems to work, too. Why? Which is more correct?Thanks,
Victor
My code is wrong. You need to Pop $R0 with Processes, but KillProcDll simply puts its output into $R0 (without using pushstring internally).
Stu
Stu
I have an issue where I need to launch an *.exe but need to kill the running process first.
The issue is the timing. Sometimes it takes a few sections to kill the running process and the *.exe gets launched from within the script (while the process has not been killed).
Further, I need to launch the *.exe silently. Using a loop to kill the process is not feasible for this situation (I’m concerned about a condition failing and my installation getting stuck in a loop – all silently). Is there an alternative? Something similar to ExecWait (where the script would wait to execute the next line until the process has been killed).
Thanks!
The issue is the timing. Sometimes it takes a few sections to kill the running process and the *.exe gets launched from within the script (while the process has not been killed).
Further, I need to launch the *.exe silently. Using a loop to kill the process is not feasible for this situation (I’m concerned about a condition failing and my installation getting stuck in a loop – all silently). Is there an alternative? Something similar to ExecWait (where the script would wait to execute the next line until the process has been killed).
Thanks!
You could try the "KillProc" plugin instead of "KillProcDLL" here:
It should be able to kill 'em all
It should be able to kill 'em all
This seems like a good plugin, something I was trying to write.
I will give it a try in a day or so. Thanks for the pointer!
I will give it a try in a day or so. Thanks for the pointer!
Originally posted by zanzBe aware: This was tested on WinXP only, never tested it on Vista...
This seems like a good plugin, something I was trying to write.
I will give it a try in a day or so. Thanks for the pointer!