Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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