Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess not kill when running windows batch file
Forum Update on Monday, May 27th 2025

QProcess not kill when running windows batch file

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 912 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shahina
    wrote on 30 Dec 2016, 08:46 last edited by
    #1

    I am running one windows batch file using as

    @echo off :loop taskkill /im "app.exe" /fi "STATUS eq NOT RESPONDING" /f >nul && start "" "C:\Program Files\app\app.exe" goto loop

    this will start application when it is not responding. I am running this batch file using qt application as

    QProcess *process= new QProcess(this);
    process->start("cmd.exe", QStringList() << "/c"<<"C:/Users/test.bat");

    i am killing the process using process->kill() in application close Event. But the process not get closed, it continuously running the batch file. Is there way to kill process properly?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 30 Dec 2016, 09:00 last edited by
      #2

      Hi
      kill() should do it but who is calling kill ?
      The app that says "not responding?"
      and did you check that the closeEvent is seen when app is task-killed ?

      1 Reply Last reply
      0

      1/2

      30 Dec 2016, 08:46

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved