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

QProcess not kill when running windows batch file

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 909 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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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

      • Login

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