Jed Evnull
2018-12-08 04:12:59 UTC
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.
QProcess p;
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!
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.
QProcess p;
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!