Qt - QProcess is not working

prabhakaran picture prabhakaran · Nov 15, 2010 · Viewed 11.6k times · Source

I try to launch internet explorer, So I use the below code

QProcess * process=new QProcess(this);
QString temp="C:\\Program Files\\Internet\ Explorer\\iexplore.exe";
process->startDetached(temp.toStdString().c_str());

But it doesn't work.

Answer

Adam W picture Adam W · Nov 15, 2010

Try:

QProcess * process=new QProcess(this);
QString temp="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\"";
process->startDetached(temp);

You need to use escaped quotes since the path has a space in it, or possibly escape all the spaces (you missed Program\ Files in the code you posted).