Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop command window from closing?

Status
Not open for further replies.

BillyKrow

Programmer
Aug 27, 2001
67
US
With prior versions of windows there used to be a "close on exit" option you could toggle on command (DOS) windows. This option seems to no longer exist in XP. I have a batch file that is running a java application and it appears to be erroring out periodically. The only problem is, the window closes immediately and therefore I can't see any exceptions that may have been thrown. Any ideas how to force the window to stay open? I suppose I could redirect the output to a file for now.
 
Put the line

pause

at the bottom of the batch file. This will cause a "Press any key to continue..." message to appear.

John
 
Hi,
You could add error trapping code that jumps to a Pause command..That should keep the window open.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Pause, why didn't I think of that. That should do the trick. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top