Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!bellcore!tness7!ninja!merch!cpe!hal6000!trsvax!craig From: craig@trsvax.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Interactive BAT files: here's how Message-ID: <216100057@trsvax> Date: 14 Oct 88 23:06:00 GMT References: <21729@decwrl.dec.com> Lines: 63 Nf-ID: #R:decwrl.dec.com:21729:trsvax:216100057:000:2283 Nf-From: trsvax.UUCP!craig Oct 14 18:06:00 1988 ->/*Written7:15 pm Oct 3,1988 by manana.dec.com!birdsall in comp.sys.ibm.pc */ ->/* ---------- "Interactive BAT files: here's how" ---------- */ ->> Subject: Interactive BAT files: HOW? ->> Posted: 29 Sep 88 00:19:14 GMT ->> Organization: Evans & Sutherland, Salt Lake City, Utah -> ->> I would like to alter my AUTOEXEC.BAT file (or another BAT file) ->> to accept interactive input. I want it to ask me a question ->> (such as who I am), and based on the answer, perform a system setup. ->> Alas, I cannot find anything in my eMeSS-DOS (3.3) manual or elsewhere ->> that tells me how to do this. Is it possible? If so, how, and which ->> book(s) describe it? -> ->Is it "possible"? Why of course! All things are possible under MS-DOS ... ->but it can be painful ... -> ->Try this: -> ->First write a C program that asks you questions and returns some value based on ->your answer. -> [Other good stuff deleted] -> ->==================================================== -> ->Have fun! -> ->walt ->/* End of text from comp.sys.ibm.pc */ You're posting has some good information for a novice user, but you're making this process too difficult. It can all be done with batch files and subdirectories. Try this: Create a subdirectory called `\STARTUP' Put the following lines in your AUTOEXEC.BAT file: ECHO OFF CLS CD \STARTUP PROMPT= Enter Choice (1 or 2): ECHO. ECHO. ECHO 1) TOM ECHO 2) FRED ECHO. In the '\STARTUP' subdirectory, create a 1.BAT and a 2.BAT file with the appropriate commands depending on the user's choice. The first few lines in both files should be something like: ECHO OFF CLS PROMPT=$P$G CD \ Advantages: doesn't require purchasing a programming language; easier to implement and understand Disadvantages: leaves extra files laying around on your disk; not as pretty ----------------------------------------------------------------------- If you don't care where you are | Craig Fleece then you aren't lost. | craig@trsvax | ninja!sys1!trsvax!craig