PDA

View Full Version : How to run Qt application from windows commandline?



aurora
26th April 2012, 06:29
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?

pkj
26th April 2012, 07:27
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.

aurora
26th April 2012, 07:43
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?

amleto
26th April 2012, 09:29
means program.exe is not in Desktop.

or if you try to run program from another user's account, it might not be accessible.

aurora
26th April 2012, 10:36
oh...ok thank u...:) i was doing silly mistake....giving wong path....now its working fine....:)