Qt World Summit: Register Today!

Using windows cmd in programs

  • hi,
    let say i need cmd commands in my program i mean when user click on the ping the program go to cmd type ping google.com and show result not only for ping command for any command in cmd like cd dir.........
    is there any class in standard c++ or c++11 or Qt do this???
    Note: i dont want to show the result in cmd i mean my program must copy the result from cmd and show in text field or text browser or any thing else.
    any guidance will be grateful.

  • Look at QProcess, should do exactly what you want for the ping. But for the cd thats a challenge to do generically. What are you trying to achieve with the "cd" - change the working directory? You can do that with the QDir::setCurrent()

Log in to reply