I'm not sure if there is a simpler way to do it, but this is how I've always handled it...
Create a text file containing your answers. One answer per line.
If all you need is one response ( either y or n ) then your text file will only have one line containing the letter y or n. If you need two responses, the first one y and the second n, you will have two lines in your text file. The letter y on the first line and the letter n on the second.
When executing or calling the batch file, use redirection to feed your responses to it.
Example: test.bat < response.txt
This will work for .com and .exe commands as well.
The only possible drawback to this method is that once your command or batchfile receives a response this way, it will no longer take responses from the command line. You will have to include all responses in the text file in the order in which you expect them to be required. This may require considerable testing for complicated batch files.