How to forcefully terminate a converter application process using batch script?

48 Views Asked by At

I've been trying to terminate a video converter application process after it run conversions for five seconds (or you could say after a given time). This is the code I've been tying to use,

@echo off
TASKLIST
TIMEOUT /T 5 /NOBREAK
TASKKILL /IM /F /T FileRx.exe

But it doesn't kill the process. Can someone shed some light on what I'm missing here?

1

There are 1 best solutions below

2
Qwerty On

You need to be careful about the order of the taskkill switches. Try the following:

taskkill.exe /F /IM FileRx.exe /T

The process name should be right after /IM. See taskkill /? for the examples.