Command to automatically input password for pscp

You can work this stuff out for yourself. Use the /? option to see the help. The pertinent parts are included below.

>pscp /?
PuTTY Secure Copy client
Release 0.60
Usage: pscp [options] [user@]host:source target
       pscp [options] source [source...] [user@]host:target
       pscp [options] -ls [user@]host:filespec
Options:
......
  -l user   connect with specified username
  -pw passw login with specified password
......

Use the -l and -pw options to specify a user and password.

So whilst that answers the specific question that you asked, the real opportunity for you is to learn how to obtain documentation from command line utilities.


pscp -pw yourPasswordHere C:\Users\testUser\Downloads\test.sh [email protected]:/home/testUser

I've noticed that no one posted sample of that command with -pw option.


From putty documentation

5.2.2.6 -pw passw login with specified password

If a password is required to connect to the host, PSCP will interactively prompt you for it. However, this may not always be appropriate. If you are running PSCP as part of some automated job, it will not be possible to enter a password by hand. The -pw option to PSCP lets you specify the password to use on the command line.