I need to run exe
from cmd
(wrap exe so that I can provide some command line options). The problem is that just calling exe from cmd does not make the package completely transparent: if .exe freezes, killing cmd, it will not kill exe. I need him to kill exe too. Can I do this on simple Windows (from XP up) without adding any dependencies?
In Bash, you have exec
, which replaces the shell process with the supplied command. This is convenient for writing shell scripts, which makes the packaging process completely transparent. I know that Windows lacks execve()
to make this possible, but I'm only interested in the parent-kill-his-child part.
CLARIFICATION: I am not looking for ways to kill exe, I am looking for ways to wrap (run) exe to kill it in the usual ways (for example, Ctrl + C or from the task manager). For example, I could create an lnk
file (Windows shortcut) and get this behavior, but I want to do this from a script (for one, lnks only works with absolute paths, I cannot expand it).
Thanks.
source share