I need to terminate a software every time it is done transcoding a movie file. To automate this I made a small batch script. Therein I tried to use taskkill like this:
taskkill /im taskname.exe /t /f
But I always get the following error message: ERROR: The process with PID 6708 could not be terminated. Reason: There is no running instance of the task.
I also tried to start the cmd window as administrator and I also tried PowerShell. But when I do tasklist afterwards, it still shows the task.
Funny thing is that the task gets instantly terminated when I right-click on it in the task manager and end task. Which command does the "end task" call in the task manager? Something I can use to automate in a batch file?