PDA

View Full Version : Dos Window



thisiswhoweare
10-11-2003, 12:12 PM
Does anyone know how to stop a dos window closing when i execute it? Doing some c and c++ coding and everytime i compile and try to run it it just zips through it and closes.... i dont want to add a read instruction in each time i want to run it, as it becomes a pain in the ass to do it each time.

thanks for any help.

ObiWan
10-11-2003, 01:55 PM
try runnimg the program from DOS instead of windows

start>run and enter cmd to bring up a dos window

thisiswhoweare
10-11-2003, 03:13 PM
What i currently do is open a dos window, and drop the dos exe file to it and enter.... im trying to find a way to just execute it through double click.

It might seem im being picky, im not, it just becomes tiresome and annoying when you have to do this process over and over again after some code fixing.

thisiswhoweare
10-11-2003, 03:14 PM
im using Windows XP btw.

noname12
10-11-2003, 03:17 PM
Originally posted by thisiswhoweare@11 October 2003 - 12:12
Does anyone know how to stop a dos window closing when i execute it? Doing some c and c++ coding and everytime i compile and try to run it it just zips through it and closes.... i dont want to add a read instruction in each time i want to run it, as it becomes a pain in the ass to do it each time.

thanks for any help.
You need to make it stay open until a value is returned such as a keypress like enter or such.
Simple as dat

ObiWan
10-11-2003, 03:28 PM
you could try adding a getch at the very END of the program

noname12
10-11-2003, 03:29 PM
I like my way better, adds a hint of n00biness to the whole thing

thisiswhoweare
10-11-2003, 03:37 PM
well whats odd is my code exits on my computer....but it stays open on the computers at my uni. is waiting for a value to be returned almost the same thing as adding a getch? if it is, its not what i want, because i shouldnt need to add it if it runs ok on other computers.....so it must be a setup wouldnt it?

thisiswhoweare
10-11-2003, 08:14 PM
installed Visual Studio and it seems to work like it does at uni if i compile and build through that :) thanks for your help still.

mbx-5
10-11-2003, 11:35 PM
Im having the same problem with UT2003. I downloaded both disks, clicling on it brings up a dos wondow then it closes strait away. Ive tried a few things but dont know enough about dos to get the game working. Im useing XP and i would be wrapped if someone could help me. Thanks. :blink:

thisiswhoweare
10-11-2003, 11:47 PM
unreal tournament 2003 should be images if you downloaded most likely... try autorunning it, or finding a install or setup.exe file. It's unlikely that dos is used to install it.

Mik3ll
10-12-2003, 01:44 AM
try right clicking on it and selecting properties, then i think there is an option in one of the tabs to stop it from closing once its done doing whatever its suppose to do

mbx-5
10-12-2003, 04:43 AM
I played with the properties. There was an option to close on exit which i un-ticked and now the dos window stays open but says the file is too big to fit in memory? What is this about imaging? Ive heard people suggest this before but dont know what its about. Thanks for the suggestions.

MUSLEMAN
10-12-2003, 04:49 AM
dos runs off of command prompt on xp there is no msdos like with other os

Sparkle1984
10-12-2003, 12:50 PM
I used to get round this problem (of the dos window closing) by adding an extra line at the end of my program saying:

system("PAUSE");

or something like that. Then when you execute the program, it will say "Press any key to continue" at the end.

But then I installed Visual Studio C++, and it works without me having to put in that extra line.