137Views5Replies

Author Options:

How Can I Add Options To My Batch File? Answered

How can I add options to my batch file?Like, for example, a box comes up with text, and has options such as abort\retry\cancel, or yes\no, etc. Please help!

Discussions

The forums are retiring in 2021 and are now closed for new topics and comments.
0
orksecurity
orksecurity

Best Answer 10 years ago

The batch language has no provision for interaction. Generally what's done is to have it invoke a program which interacts with the user and leaves the answer in a testable place -- the program's return code, or creating/destroying a scratchfile which can be tested with "if exists".

0
Prof. Pickle
Prof. Pickle

8 years ago

You can't do anything like this using batch files (as far as I know) but I do know that you can do this with VBS.

0
orksecurity
orksecurity

10 years ago

(I should say: You can, of course, read parameters from the rest of the command line. Or you can do a "press any key" using the pause keyword. But that's about it without helper programs. At least, unless Microsoft snuck another weirdity past us when I wasn't paying attention.)

0
Files
Files

Answer 10 years ago

Hmm.. I think I'm going to try that. That sounds like it will work.

0
Files
Files

10 years ago

Okay, thank you.I could of sworn I've seen it before, but that might have been a VBS file..Thanks for the tip, I'll try something along those lines in due time.