ssk
ssk

Reputation: 9265

Find a process by name and kill it

I have a Qt based updater application that needs to replace a running process with the new file. On Windows, the updater is failing when the process is running.

Is there a way that I can find a process by name e.g, Firefox.exe and kill it using Qt?

Upvotes: 0

Views: 1528

Answers (2)

karlphillip
karlphillip

Reputation: 93468

There's no API to do this in Qt, which means the only way to do it is using platform specific code.

Upvotes: 2

Alexey
Alexey

Reputation: 683

You can call system like this: taskkill /f /im firefox.exe

Upvotes: 3

Related Questions