Results 1 to 4 of 4

Thread: How to ran a batch file script using cmd?

  1. #1
    Join Date
    Oct 2012
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to ran a batch file script using cmd?

    Hi Guys,

    Currently I'm using QProcess to run a batch file. Since batch files won't work on Linux and my application should both run on both Windows and Linux, Is there a way how to place the script in the cmd then run the script using c++. Basically, I'm utilizing a GUI to execute this process. Once the user clicks the button, it automatically runs the script using the cmd prompt.

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to ran a batch file script using cmd?

    What script are we talking about? And in general if it a windows specific batch file, you cannot run it under Linux nor transform it automatically to c++.

  3. #3
    Join Date
    Oct 2012
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to ran a batch file script using cmd?

    Hi Lykurg!

    This is the sample of the script containing the batch file I'm referring to:

    c:\ghs\ppc424\gbuild -all -top Y:\asic-advsw-hw\to_ace\To_Kevin\ME06\MultiProj\EDiskBFHelios440 gx.gpj

    Is there a way that instead using batch file, I'll gonna call the COMMAND PROMPT and run this script? How can i launch the command prompt automatically using c++ then this script must also append into the prompt?

    Thanks!

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to ran a batch file script using cmd?

    Ok, now I am a little puzzled. To get things right: You have a GUI where the user can define arguments for a command line tool, namely Green Hills MULTI. So as far as I can see, they also provide a development and build environment for linux. So If it is installed on the linux machine you should can call gbuild like you do in windows.

    Or what I do get wrong?

Similar Threads

  1. Replies: 4
    Last Post: 15th July 2012, 02:41
  2. QProcess running batch file
    By Vit Stepanek in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2010, 14:23
  3. Replies: 7
    Last Post: 14th June 2010, 02:42
  4. distclean batch file
    By talk2amulya in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2009, 12:19
  5. QProcess problem with windows batch file
    By bood in forum Qt Programming
    Replies: 11
    Last Post: 6th January 2006, 08:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.