Reputation: 129
im coding a program that starts an command prompt boot application ,at run time of the boot application,the boot application asks many questions like for eg.press 1 to read or 2 to write.but always i'll be reading from the app.i always want to pass 2 to it.but the issue is how should i know that the back ground boot application has asked me a question and that i should reply with appropriate answer dynamically?
Upvotes: 2
Views: 845
Reputation: 612804
If the program reads the input from the standard input then you can create a text file containing your input:
2
Then redirect the standard input to that file:
myapp.exe < inputfile.txt
Perhaps the program has command line options that would also allow you to avoid being prompted.
Note that your question is ambigous. If you are choosing the option to read, shouldn't you input 1?
Upvotes: 2