Results 1 to 5 of 5

Thread: How to run Qt application from windows commandline?

  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default How to run Qt application from windows commandline?

    I developed Qt application using "Qt Creator 2.3.0 Based on Qt 4.7.4 (32 bit)".
    I got its ".exe" file which run perfectly after double click on it.
    But I want users of this application to run it from their windows command line.
    How can i do that? what command they must type to run the application?

  2. #2
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to run Qt application from windows commandline?

    It will always work to launch your application from the command prompt if your command window is in the right folder where your executeable is or if you provide the fill path together with the command like



    C:\> D:\MyFiles\Something\This\myApp.exe



    If you want to have myApp.exe work regardless of the folder you are in and without a path you have eigther to copy your executeable to a known search path or add the path of your executeable to the known search paths found in Control Panel --> System ---> Advanced --> Environment Variables --> System Variables

    Find the entry for PATH in this list and either edit it or copy your exe to one of the paths existing in this list.

  3. #3
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run Qt application from windows commandline?

    Thanks for ur reply....
    But i'm getting error...

    if i give c:\User\Desktop\program.exe
    the error msg will be---> The system cannot find the path specified.

    if i give c:\User\Desktop\program
    the error msg will be--->
    'singleFile' is not recognized as an internal or external command,
    operable program or batch file.

    Please tell me whats wrong here?

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run Qt application from windows commandline?

    means program.exe is not in Desktop.

    or if you try to run program from another user's account, it might not be accessible.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to run Qt application from windows commandline?

    oh...ok thank u... i was doing silly mistake....giving wong path....now its working fine....

Similar Threads

  1. Replies: 5
    Last Post: 4th April 2012, 03:41
  2. Replies: 2
    Last Post: 31st March 2011, 10:09
  3. Replies: 2
    Last Post: 30th March 2011, 10:11
  4. Design a commandline widget in Qt4?
    By Ran in forum Qt Programming
    Replies: 8
    Last Post: 7th January 2009, 04:14
  5. coding a commandLine class
    By mickey in forum General Programming
    Replies: 8
    Last Post: 27th November 2007, 09:46

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.