# Auto answer to multiple question

**URL:** <https://forums.powershell.org/t/auto-answer-to-multiple-question/16551>\
**Category:** PowerShell Help\
**Created:** [May 18, 2021, 7:28am UTC](https://forums.powershell.org/t/auto-answer-to-multiple-question/16551 "2021-05-18T07:28:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghost68](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@ghost68](https://forums.powershell.org/u/ghost68)\
**Post date:** [May 18, 2021, 7:28am UTC](https://forums.powershell.org/t/auto-answer-to-multiple-question/16551/1 "2021-05-18T07:28:37Z")

</div>

Hello,  
I’m trying to write a powershell script to enable authentication on a Crestron processor (with plink command).  
When I activate authentication, the system asks me to enter the administrator username, then the password and finally enter the password again to confirm.  
Of course, I would like the script to do this automatically.  
I got there in batch but I can’t do the same in Powershell.  
Here is the batch version:

(  
timeout 2 \> nul  
echo username  
timeout 3 \> nul  
echo password  
timeout 3 \> nul  
echo password  
) | plink -ssh -v -batch -l oldUsername -pw oldpassword %Processor\_IP% “auth on”

Could you help me,  
Thanks

---

<div class="post-metadata">

**Author:** ![ghost68](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@ghost68](https://forums.powershell.org/u/ghost68)\
**Post date:** [May 18, 2021, 7:37am UTC](https://forums.powershell.org/t/auto-answer-to-multiple-question/16551/2 "2021-05-18T07:37:26Z")

</div>

For those who prefer, the batch command can also be written as a line :

(echo username & timeout 3 \> nul & echo password & timeout 3 \> nul & echo password & timeout 3 \> nul) | plink -ssh -v -batch -l oldusername -pw oldpassword %Processor\_IP% “auth on”

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:26pm UTC](https://forums.powershell.org/t/auto-answer-to-multiple-question/16551/3 "2024-05-16T20:26:24Z")

</div>


