Open a .exe from qt
-
wrote on 23 Jun 2014, 17:53 last edited by
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 -
wrote on 23 Jun 2014, 18:35 last edited by
Use QProcess
-
wrote on 23 Jun 2014, 20:37 last edited by
@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 -
Hi,
Because the path is wrong, either escape your backslashes or use forward slash (which is the right thing to do with Qt)
-
wrote on 23 Jun 2014, 21:14 last edited by
please tell me why you said that the path is wrong
-
I already did: you didn't escape the backslashes. So in fact you are escaping w twice.
-
wrote on 23 Jun 2014, 21:38 last edited by
@ 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 -
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
-
wrote on 24 Jun 2014, 04:40 last edited by
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.
5/9