Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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. ☺

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .