Executing commands in cmd.exe using QProcess
-
Hello,
I was trying to do this:
@
Process->start("cmd.exe",QStringList()<<"C:/Users/Admin/Desktop/test.txt");
@To check if the command works but it doesn't , it shows "" in the app output.
test.txt is in the desktop and I want to open it.
-
@
Process->start("cmd.exe /C start C:/Users/Admin/Desktop/test.txt");@
-
Thank you guys , both works fine , but why /C ? I don't use command line much but I don't think it's a command right ?
-
It executes the commands that follow as a script. Without it, cmd.exe would be opened and wait for input from keyboard.