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 fails using Qt5.11x and Windows 7

QProcess fails using Qt5.11x and Windows 7

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 481 Views 2 Watching
  • 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.
  • J Offline
    J Offline
    Jedd
    wrote on last edited by
    #1

    I'm attempting to open a cmd console in Windows using Qt 5.11x. The code fragment below has worked reliably for a long while and continues to work well for Windows 10 and Windows 8x. However, for Windows 7 the cmd console just blinks and goes away.

    I've tried modifying the argument to just call cmd.exe (no .bat file) and also included the full path to cmd.exe, neither change mattered.

    QProcess p;
    p.setProgram("cmd.exe");
    p.setArguments({"/k", QDir::currentPath()+"/cpath.bat"});
    p.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments
    *args) {
            args->flags &= ~CREATE_NO_WINDOW;
        });
    p.startDetached();
    
    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jedd
      wrote on last edited by
      #2

      Sorry for the bump, anyone with any thoughts on this issue? I'm stumped as to why this fails using Windows 7...

      1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Bump after 2 days is very acceptable.

        I was wondering about it too. I dont have any win 7 to test on, but
        i swear cmd.exe /k used to work.
        Did you test on more than 1 win 7 ?
        Something could be up on that system.
        Also, if you do manually start cmd.exe on the system, it
        does stay open ?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dmulvang
          wrote on last edited by
          #4

          Hi. I face the same issue on windows 7. Did you find a solution to the issue?

          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