system and dos window

Posted on 2005-05-16
Last Modified: 2013-11-15
i am programming with C++ under DevC++. I am using some .exe files which are compiled with cygwin. Everything works good, and the Problem is: when I call the .exe file with system("file.exe") it runs the dos window, does what he should do, and the dos window disapear. Sometimes i want to see what happens, so I need the dos window open.
I tried :
this way it appear another dos window which stopps the other(first) window, BUT i cant read what is in the first dos window.

thanks for your help.

Question by:imedghar
    LVL 55

    Accepted Solution

    try with system("cmd /k file.exe");
    LVL 3

    Expert Comment

    well if you just need to use this for testing purposes a simple fix would be to have the system call run a batch file.  The batch file would kick off your .exe and then have the pause statement.  This way things should still happen in the same dos window.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
    Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now