I'm using the following code to launch a process. The program exists and I can run it on the command line. The code snippet from the slot/method trying to launch the program:
Qt Code:
  1. process = new QProcess; // process is a member of my class typed QProcess*
  2. connect(
  3. &process, SIGNAL (error(QProcess::ProcessError)),
  4. this, SLOT(sdLaunchError (QProcess::ProcessError)));
  5.  
  6. QString path("C:\\Program Files\\My Compay\\MyCompanyMonitor");
  7.  
  8. QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
  9. process->setWorkingDirectory(path);
  10. QString fullPath = path + ";" + env.value("Path");
  11. env.insert("PATH", fullPath);
  12. process->setProcessEnvironment(env);
  13.  
  14. process->start("Monitor");
To copy to clipboard, switch view to plain text mode 
The error I get when I call errorString from sdLaunchError (the slot called when the QProcess::error signal is called) is "No such file or directory". The file is definitely there. I've tried changing the call to QProcess::setWorkingDirectory to the following (so that the path with spaces is enclosed in quotes):
Qt Code:
  1. process.setWorkingDirectory("\"" + path + "\"");
To copy to clipboard, switch view to plain text mode 
I tried adding QIODevice::NotOpen to QProcess::start call. I tried changing the call to ::start to include the extension:
Qt Code:
  1. process.start("Monitor.exe);
To copy to clipboard, switch view to plain text mode 
In a command prompt, I emulated this in the following way:
C:
cd \
set PATH=C:\Program Files\My Company\MyCompanyMonitor;%PATH%
Monitor

And the program runs. What am I doing wrong? (As an aside, I've launched programs several times on Linux with no problems on other projects).

I'm running with Qt 4.6.0 on Windows XP.

Thanks in advance!