Re: QProcess problem with windows batch file

Originally Posted by
wysota
It affects the place QProcess looks for the file. Look, that you have given a relative path (dir/file) to that file, so QProcess looks for it there and only there.
I don't think so...
QProcess always looks for the file from the working directory of the process in which QProcess runs. And what QProcess::setWorkingDirectory sets is the working directory of the created process, they are different.
And if you're right, there's no reason that it works well when dealing with exefile. You can try replacing the test.bat with an ordinary exefile, and change the macro EXE defined in main.cpp correspondly. You'll find everything works fine.
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