0

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?

sashoalm
  • 75,001
  • 122
  • 434
  • 781
ssk
  • 9,045
  • 26
  • 96
  • 169
  • possible duplicate of [how to find the running process and kill the process in QT?](http://stackoverflow.com/questions/4538967/how-to-find-the-running-process-and-kill-the-process-in-qt) – karlphillip Apr 19 '12 at 16:32
  • [Is there a way to list current processes using Qt on windows?](http://stackoverflow.com/questions/833113/is-there-a-way-to-list-current-processes-using-qt-on-windows) – karlphillip Apr 19 '12 at 16:34

2 Answers2

3

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

Alexey
  • 593
  • 1
  • 5
  • 14
2

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

karlphillip
  • 92,053
  • 36
  • 243
  • 426