ms dos help
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: ms dos help

  1. #1
    Banned
    Join Date
    Dec 2002
    Posts
    20

    Question ms dos help

    i cant find anyware better to place this so i put it here. how do u stop windows from closing a dos box. i hav some dos programs i need to run and it opens them then closes them really quick befor i can doo anything. is there a way to turn this off or am i sol?

  2. #2
    AO übergeek phishphreek's Avatar
    Join Date
    Jan 2002
    Posts
    4,325
    Try running them from a command prompt.

    Or, create a script and put a couple of pause statements in there.
    Quitmzilla is a firefox extension that gives you stats on how long you have quit smoking, how much money you\'ve saved, how much you haven\'t smoked and recent milestones. Very helpful for people who quit smoking and used to smoke at their computers... Helps out with the urges.

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    start them from a command prompt. that is start a dos window (start>>run>>command) now navigate to the folder the game is in (c:\games\) and just type the name of the main exe. or bat file (mario)

    there's really many ways to do this. give more info like the os your using what games were talking about etc
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  4. #4
    Banned
    Join Date
    Dec 2002
    Posts
    20
    im on xp and into c++ and some of the things i want to try i need the box to stay open.

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    same thing man. if you start a program from within dos the dos window stays open after the program finnishes. what compiler allot of the windows compilers have an option to open a dos prompt for this purpose.
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  6. #6
    Banned
    Join Date
    Dec 2002
    Posts
    20
    Dev-C++

  7. #7
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    http://www.geocities.com/uniqueness_template/

    Method 1 - Scaffolding:
    Add the following code before any return statement in main() or any exit() or abort() statement (in any function):

    /* Scaffolding code for testing purposes */
    cin.ignore(256, '\n');
    cout << "Press ENTER to continue..." << endl;
    cin.get();
    /* End Scaffolding */

    This will give you a chance to view any output before the program terminates and the window closes.

    Method 2 - Command-prompt:
    Alternatively, instead of using Dev-C++ to invoke your program, you can just open an MS-DOS Prompt, go to the directory where your program was compiled (i.e. where you saved the project) and enter the program name (along with any parameters). The command-prompt window will not close when the program terminates.
    For what it's worth, I use the command-line method.

    +=+=+=+=+=+=+=+=+=+

    try

    system(pause)

    before return

    you could of course use the gcc that bloodshed bases their product on from the command line and not have to switch back and forth.

    gcc -o my.exe my.cpp
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  8. #8
    The Iceman Cometh
    Join Date
    Aug 2001
    Posts
    1,209
    Tedob, in my opinion, has a good method with his scaffolding code. I use something like this in my programs, though in a slightly different way. I do the following:

    Code:
    #include statements
    
    #define DEBUG
    
    function prototypes
    
    int main()
    {
      blah blah
    
      #ifdef DEBUG
      /* Insert scaffolding statements here */
      #endif
    
      blah blah
    }
    The advantage to doing this, once you are satsified with your program and no longer need the scaffolding statements, you can simply comment out the #define DEBUG line and they will no longer appear. I use this often because I set up debugging statements throughout my programs (temporary couts of variables, memory addresses, etc.), which I may want to use again if I decide to go back and modify my program. With the #define at the top, you will never have to remove the statements or comment them all out when you don't need them anymore... you just have to comment out the one line and your set. Think of it kind of like a global constant, once it's set, it doesn't change, but you can access it as much or as little as you want.

    AJ

  9. #9
    Banned
    Join Date
    Dec 2002
    Posts
    20
    thanks all that really helped

  10. #10
    Banned
    Join Date
    Dec 2002
    Posts
    394
    the only way I can think of is from as already stated[quote command prompt[/quote]
    that will do the job hehe! Running from the IDE of C++ will bring U back to its IDE when code has complete running

    Don't U love the power cooooodddddddding

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •