0

I'm trying to start a console application on Windows using QProcess's method 'start'. Official documentation says I can do it like this:

QProcess process;
process.start("C:/Windows/System32/cmd.exe");

I expect that a standard greeting message will appear in the calling application's console, but this does not happen, though the called process is running. What is wrong here?

2 Answers2

1

use of bellow example :

QProcess *process = new QProcess(this);
QString program = "explorer.exe";
QString folder = "C:\";
process->start(program, QStringList() << folder);

also you can use of system() as bellow :

system("C:/Windows/System32/cmd.exe");
1

How about this static call?

QProcess::startDetached(FilePath,Arguments,StartInDir);

No need to create any objects!

The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189