0

I have a batch file(install.bat which i use to insatll my application) which prompts user with few questions like 'To accept licencse agreement click y/n'.So what i was thinking to provide the answers from a text file. i have Created a text file with the answers (e.g. answers.txt):

 y
 n
 y
 y

i have Created a wrapper batch file that runs my installation batch and redirects its input from the answers file (wrapper.bat):

@echo off
install.bat < answers.txt

is there any thing that i am missing beacuse its not working properly,i am not sure if install.bat taking some null values from the text file.

1
  • Oh, so I see, "its not working properly". Great. On Saturdays I am a psycic, so next Saturday I will figure out exactly how "its not working properly" (error messages and everything) and I will let you know. Commented Mar 24, 2015 at 18:57

1 Answer 1

1

install.bat:

set /p a=Alpha
set /p b=Beta
set /p c=Gamma
set /p d=Delta
echo %a%,%b%,%c%,%d%

answers.txt:

a
b
c
d

call it like this:

install.bat<answers.txt
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks Stephan for your response but i dont want to make any changes to install.bat file.
it was only meant to be an example - a "dummy-install.bat". If it doesn't work, you'll have to share the applicable parts of your install.bat.
basically there are two batch files and the first batch file contains the code like this "@echo off cd bin call B.bat load-and-start %1" and the second batch file contains the whole code(and questions) to install our application .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.