Results 1 to 12 of 12

Thread: QProcess problem with windows batch file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Shanghai, China
    Posts
    52
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QProcess problem with windows batch file

    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:
    Qt Code:
    1. process1.start("bin/test.bat");
    2. process1.waitForFinished();
    3. 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:
    Qt Code:
    1. 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?
    Attached Files Attached Files
    Last edited by bood; 6th January 2006 at 06:52.
    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.

Similar Threads

  1. Qt + Portmidi in Windows... libraries problem
    By hipogrito in forum Newbie
    Replies: 2
    Last Post: 19th June 2009, 00:01
  2. Draging a non-existing file to the Windows Desktop
    By klaus1111 in forum Qt Programming
    Replies: 13
    Last Post: 20th September 2007, 11:47
  3. Replies: 3
    Last Post: 4th September 2007, 14:40
  4. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25
  5. QProcess +standard error + windows
    By antonio.r.tome in forum Qt Programming
    Replies: 0
    Last Post: 18th April 2006, 14:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.