This to avoid interactive password prompting.
The more advanced/secure method for this is using the public- / private-key mechanism, where the private key is stored on the source system and the related public key is stored on the target system where you want to log-in without providing a password.
However, in both cases it is needed to protect the private key file or file where the plain password is saved from unwanted access.
Of course special care is needed on if, where and how to store the plain text password.
set "SSH_ASKPASS=%WA2L_INSTALLDIR%\lib\askpass_util.exe" set "SSH_ASKPASS_REQUIRE=force" set "ASKPASS_PASSWORD=S3creT" scp -p file.txt acme-007:"H:\tmp\transfer" scp -p file.txt acme-008:"H:\tmp\input" scp -p file.txt acme-009:"H:\tmp\archive"
set "SSH_ASKPASS=%WA2L_INSTALLDIR%\lib\askpass_util.exe" set "SSH_ASKPASS_REQUIRE=force" call "%WA2L_INSTALLDIR%\lib\setv" -p "Password: " -m ASKPASS_PASSWORD scp -p file.txt acme-007:"H:\tmp\transfer" scp -p file.txt acme-008:"H:\tmp\input" scp -p file.txt acme-009:"H:\tmp\archive"
This is free software; see WA2LWinTools/man/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.