QT4.1.0-rc1 + Qt-Win Free, VS2003, WinXP
I'm using QProcess::start to execute a batch file in windows
The batch file's under a child folder(bin), core code like this:
process1.start("bin/test.bat");
process1.waitForFinished();
process1.start("bin/test.bat");
process1.waitForFinished();
QString out1=process1.readAll();
To copy to clipboard, switch view to plain text mode
Everything seems normal until I added a line before calling start:
process1.
setWorkingDirectory(QDir::currentPath()+"/bin");
process1.setWorkingDirectory(QDir::currentPath()+"/bin");
To copy to clipboard, switch view to plain text mode
I cannot get anything from out1 then...
And I find that there won't be any problem when replace the batch file with an exe one
You can get an example from attachment
Note: make sure the current directory is the dir contains the 'bin' when running the exefile
p.s. seems I cannot upload the attachment here, system problem?
Bookmarks