I am new to windows batch scripting. Need help with this. My question is, I am running a jar file which asks for inputs. I am providing the input in the text file and i am able to execute it with the below command successfully.
java -cp abc.jar<input.txt
echo Y >> input.txt
echo 1 >> input.txt
type out.txt >> input.txt
@echo off > input.txt ( echo Y echo 1 type out.txt )
@echo off > input.txt echo Y >> input.txt echo 1 >> input.txt type out.txt
The main "problem" with your code is that the
>> operator will append to the file. If it already exist, the new data is appended after the previous data. You need to first remove the file or ensure it is overwritten.