[Development] QProcess doesn't run cmd.exe

Jed Evnull jedevnull at gmail.com
Mon Dec 10 17:41:23 CET 2018


Thank you.  Bug submitted: QTBUG-72456
<https://bugreports.qt.io/browse/QTBUG-72456>

On Mon, Dec 10, 2018 at 2:49 AM Joerg Bornemann <Joerg.Bornemann at qt.io>
wrote:

> On 12/8/18 5:12 AM, Jed Evnull wrote:
>
> > I'm attempting to open a cmd.exe console in Windows using Qt 5.11x. The
> > code fragment below works reliably for Windows 10 and Windows 8x.
> > However, for Windows 7 what appears to be a console window just blinks
> > and goes away. I've tried modifying the argument to just call cmd.exe
> > (no .bat file) and also included the full path to cmd.exe, neither
> > change mattered.
> >
> >
> |QProcessp;p.setProgram("cmd.exe");p.setArguments({"/k",QDir::currentPath()+"/cpath.bat"});p.setCreateProcessArgumentsModifier([](QProcess::CreateProcessArguments*args){args->flags
>
> > &=~CREATE_NO_WINDOW;});p.startDetached();|
> >
> > |I've asked this question elsewhere and have gotten no responses. Please
> > help!|
>
> There's no Windows 10 specific API involved. So it's quite surprising
> that the example should not work on Windows 7.
>
> The call to startDetached boils down to a simple CreateProcess call.
> Please try to call CreateProcess directly, and if that works (and
> QProcess does not) file a bug report.
>
>
> Cheers,
>
> Joerg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20181210/b7c88119/attachment.html>


More information about the Development mailing list