Batch programming (DOS/Windows) question

Joined
Nov 2, 2009
Messages
667
I've written a simple batch file so that a USB memory stick can work as a second hard drive with reliable paths, instead of flitting around E:, F:, etc.

I'd like to run the file at Startup and have it report a success/fail message, depending on whether it detects the memory stick.

However, when the file is done, it closes the window before the success/fail message can be read. How can I make the window persist?

The best think I can think of is to create a fake user input. The window will stay open while it waits for user input (which will never come, I'll just close the window once I've read the message). But Windows XP doesn't have the <choice> command... how do I get user input in an XP batch file???

(Using Windows XP Home SP3)
 
Batch files are like a lost art. I remember back in DOS days you had to know how to right them just to get some computer games running rightly. I've forgotten how though.

Are you sure there isn't some kind of Windows option to make the window persist?

And there's a PAUSE command evidently. Should do what you want.
source: http://www.computerhope.com/batch.htm#02
 
I think "pause" is the command you're looking for - it gives a "hit a key to continue" prompt in the DOS window.
 
Top Bottom