Open a .exe from qt
-
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 -
Use QProcess
-
@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)
-
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.
-
@ 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
-
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.