Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QProcess unable to open .vbs file !!

QProcess unable to open .vbs file !!

Scheduled Pinned Locked Moved Qt Creator and other tools
9 Posts 2 Posters 5.0k 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.
  • R Offline
    R Offline
    rajatgupta431
    wrote on last edited by
    #1

    Am trying to open a .vbs file using startDetached() ; of QProcess.....its not opening the file...whereas it is able to open the batch file which lies in same working directory ...Please Help :)

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      How should QProcess know how to run the file? It is a binary executable? If not, you need to specify an application that can open it.

      (Z(:^

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rajatgupta431
        wrote on last edited by
        #3

        Can you suggest me a way to open a .vbs file in the working directory from the Qt application?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          I do not know what a .vbs file is.

          (Z(:^

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rajatgupta431
            wrote on last edited by
            #5

            its just a Visual Basic script.....if i give a system() command from code to execute the file it does the work...but don't want to use system() function...

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Visual Basic needs to have some interpreter somewhere, I imagine. You need to run that interpreter and pass the file as an argument. I'm not using VB so I can't really say anything more constructive. Or switch to a decent scripting language like Python, Lua, bash, etc.

              (Z(:^

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rajatgupta431
                wrote on last edited by
                #7

                Actually i have to run a batch file that open cmd....so i am using a Vbscript to silently open the batch file without opening the cmd. But for opening the .vbs file even i am bound to use system() if it doesn't open with QProcess.

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  You can open cmd silently with QProcess, AFAIK. But I'm not a Windows guru, so I can't be sure. As in many other situations, those things are quite easy in Unix.

                  (Z(:^

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    rajatgupta431
                    wrote on last edited by
                    #9

                    its ok ...thanks for the help....looking on for more replies :)

                    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