hello,
how i can close a win shell (DOS/Box/Shell) programm automatical?
now it says "press a key to ......."
after the programm stops...
Printable View
hello,
how i can close a win shell (DOS/Box/Shell) programm automatical?
now it says "press a key to ......."
after the programm stops...
add the line return 0; to your main method. this only works for console
i have in code
return 0;
}
but under win98 + xp there comes the sentence still again at my tests...
well where are you running the exe from? a DOS prompt? windows explorer? or visual studio itself? VS wont drop out automatically but the other 2 will.
in a DOS prompt
you want it to close the DOS box? or it's simply not dropping out back to the dos prompt? either way it's weird because i dont think you can do the first and the second should just happen for you.
yes, just want that the DOS box geht closed automatic.
normaly i can make like system, exit call, but the problem is the "press the key"..... comes after the programm
Just a wild-guess, but check you program to see if you have cin.ignore(), which will display that message.
... Also, are you starting your program via a batch file and have a pause in the batch file?
if you type your executable at the DOS prompt your program exits back to it whether or not the "Press any key" message is shown.
i dont think you're actually doing that based on what you describe so i still dont understand how you are launching your program.
when your program runs do you type in the filename in DOS or do you double click something from windows?