4

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?

Gareth
  • 19,080
V_H
  • 205

1 Answers1

2

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

JdeBP
  • 27,556
  • 1
  • 77
  • 106