Re: QProcess problem with windows batch file

Originally Posted by
wysota
Oh, you're calling a QProcess::setWorkingDirectory() method... You're right then, it doesn't influence where QProcess looks for the program.
How does your script work?
Did you download my example in my first post?
The example has two QProcess, one without setWorkingDirectory called before calling start(QProcess1), while the other does(QProcess2). And both QProcess start a batch file called test.bat under `bin` directory(the batch file just has an echo command to output a string), then readAll is called to collect the output which is later presented in a QMessageBox. You'll find the output collected from QProcess1 is empty while the other works as I expected.
1. Users don't have the manual, and if they did, they wouldn't read it.
2. In fact, users can't read anything, and if they could, they wouldn't want to.
Bookmarks