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. Open a .exe from qt

Open a .exe from qt

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 1.9k 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.
  • Y Offline
    Y Offline
    yakine
    wrote on last edited by
    #1

    hello
    so i have a question and i hope that you help me
    i wondred if there is away to open an exe from qt ?
    please help

    IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

    1 Reply Last reply
    0
    • K Offline
      K Offline
      krsmichael
      wrote on last edited by
      #2

      Use QProcess

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yakine
        wrote on last edited by
        #3

        @QProcess wampOnline;

        bool ok=wampOnline.startDetached("C:\wamp\wampmanager.exe");//
        if(ok)
        {
        qDebug()<<"ok";
        }
        else
        {
        qDebug()<<"no";
        }@
        this is my code but it's show no please help

        IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Because the path is wrong, either escape your backslashes or use forward slash (which is the right thing to do with Qt)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            yakine
            wrote on last edited by
            #5

            please tell me why you said that the path is wrong

            IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I already did: you didn't escape the backslashes. So in fact you are escaping w twice.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                yakine
                wrote on last edited by
                #7

                @ bool ok=wampOnline.startDetached("C:\wamp\wampmanager.exe");//

                if(ok)
                
                
                {
                
                
                 qDebug()<<"ok";
                
                
                }
                
                
                else
                
                
                {
                
                
                qDebug()<<"no";
                
                
                }@
                

                you mean like this
                i tried also this@bool ok=wampOnline.startDetached("C://wamp//wampmanager.exe")@ and this @bool ok=wampOnline.startDetached("C:/wamp/wampmanager.exe")@
                but still the same problem

                IF YOU HAVE MERCY ON PEOPLE GOD HAVE MERCY ON YOU

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Also, startDetached is a static function so you're not calling it the right way. You should first look at QProcess documentation to see how to use it properly and check why it's failing for wampmanager.exe

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • IamSumitI Offline
                    IamSumitI Offline
                    IamSumit
                    wrote on last edited by
                    #9

                    Hiii,
                    (just a guess.)
                    Could be administrator privilege issue for accessing C drive.
                    please check that you are running your application in administrator account.
                    and also do check the various permissions of wampmanager.exe.

                    Be Cute

                    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