Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to use Taskkill as Ctrl-C to end process?

So I have a batch that continues in a infinitive loop. If I run the batch through cmd I can use Ctrl+C which will stop the batch and give me an summary of the output like:

Started       12:07:13.512876
End           12:07:14.824966
Captured for   0:00:01.312090

So I tried using this:

Start /B program.exe > "C:\text.txt"

:: Timeout
Timeout /T 60

:: Kill the exe...
TASKKILL /T /F /IM cmd.exe

This will just end the output from the batch in the middle of a sentence where Ctrl-C lets the batch continue its sentence and gives me a summary. Is there any way to use Ctrl-C like taskkill? Because I still want to end the process after X amount of time.

Comments