[comp.sys.ibm.pc] Interactive BAT files: HOW?

angerhof@esunix.UUCP (Norman Angerhofer) (09/29/88)

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?

Many thanks.
  --Norman

Norman Angerhofer       uucp:  ...{decvax,ucbvax,ihnp4}!decwrl!esunix!angerhof
540 Arapeen Dr.                           or  ...ihnp4!utah-cs!esunix!angerhof
SLC, UT  84108          ARPA:  angerhof%esunix.uucp@cs.utah.edu

brown@nicmad.UUCP (Mr. Video) (10/01/88)

In article <985@esunix.UUCP> angerhof@esunix.UUCP (Norman Angerhofer) writes:
<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?

MS-DOS does not allow interactive sessions in .BAT files.  To give it that
feature would require the use of a utility like Norton's ASK.  It asks the
question and put the answer in the environment.
-- 
	       harvard-\	 att--\
Mr. Video         ucbvax!uwvax!astroatc!nicmad!brown
	       rutgers-/      decvax--/
	INTERNET: astroatc.UUCP!nicmad!brown@spool.cs.wisc.edu

rmarks@KSP.Unisys.COM (Richard Marks) (10/03/88)

In article <3251@nicmad.UUCP> brown@nicmad.UUCP (Mr. Video) writes:
>In article <985@esunix.UUCP> angerhof@esunix.UUCP (Norman Angerhofer) writes:
><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.
>
>MS-DOS does not allow interactive sessions in .BAT files.  To give it that
>feature would require the use of a utility like Norton's ASK.  It asks the
>question and put the answer in the environment.

Last winter I posted a program, SETENV, to comp.binaries... that let you
ask a question and then set an environment variable to the response.

Richard Marks
rmarks@KSP.unisys.COM

nts0302@dsacg3.UUCP (Bob Fisher) (10/05/88)

I got this off USENET about a year ago.  I don't know who to give credit
to.

ASK is a program that displays what is on the command line and then
loops until a yes or no response is entered.  Test errorlevel to determine
the answer.  Object file is 512 bytes.  Use the .BAT file sequence

	ask THE_QUESTION
	if errorlevel 1 reply_was_no

You can use trailing blanks with THE_QUESTION to separate the question
and answer which are on the same line.  THE_QUESTION may also include
screen control sequences such as setting/restoring inverse/colors.


----------------- CUT HERE AND UUDECODE ---------------------
begin 644 ask.com
MZ`<`Z#``M$S-(;$DOX``BQ6V`(/Z`'06@_H\=!&!PH``B_)&B`RZ@@"T"<TA
MP[IZ`;0)S2'#M`RP!\TA/%ET%3QY=!$\3G0:/&YT%KIO`;0)S2'KX:**`;J*
M`;0)S2&P`,.BB@&ZB@&T"<TAL`'##0HH62].*2`_("10<F5S<R!9(&]R($X@
M/R`D(`T*)```````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````!H@;W(@3B`_("0@#0HD
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````93D)```-```````.``X`````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
1````````````````````````
`
end
-- 
Bob Fisher (osu-cis!dsacg1!bfisher) 614-238-9071 (Autovon 850-9071)
From the Internet: bfisher%dsacg1.uucp@daitc.arpa
US Defense Logistics Agency Systems Automation Center
DSAC-TSX, Box 1605, Columbus, OH 43216-5002