I have a process that doesn't behave when I do a taskkill -f, but the only option taskkill gives me is to kill it with -f.

When I have the exe running in the Command Prompt I can hit Ctrl + C twice and it exits gracefully with a keyboard interrupt message (it's a Python compiled exe).

How can I simulate this behavior from the command line?

link|improve this question

50% accept rate
feedback

1 Answer

That depends from what command-line tools you have. If you have JP Software's TCC/LE, you just activate the running program's console's window with the ACTIVATE command and then use the KEYSTACK command to simulate that keystroke as input to the window with:

KEYSTACK Ctrl-C

Of course, if your program does not actually have a console when run, you do not have the option of simulating pressing Ctrl+C in its console. ☺

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.