How can I answer a completed cmd question?

-2

I am automating a process through a .bat file and at a certain point cmd asks me a question, I would like to know how I can respond.

I tried:

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore app-release-unsigned.apk alias_name //Meu comando que solicita uma senha no cmd

    "/senhaultrasecreta" //resposta que devo dar ao cmd

pause

I've also tried only "passwordregister" but the cmd tries to run as a file.

Is there a way to automatically reply to this message?

@Edit:

I've tried echo "senhaultrasecreta" but it is not written

    
asked by anonymous 25.10.2018 / 15:00

1 answer

1

Who cares, I was able to respond using "|" and to the left the message that I want to be typed:

echo senhaultrasecreta | jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore app-release-unsigned.apk alias_name

I do not understand why so many downvotes and no answer / feedback for my question

    
25.10.2018 / 15:16