3

I'm trying to automate file upload by creating .bat file which when run will upload files to SFTP server. I would like to automate this process, but sftp command line asks for password. Is there a way to enter the password in .bat file to automate it?

This is the code I'm using. It works, but user needs to enter the password. Is there a way to create batch file where password will be entered automatically?

sftp user@ip
password
put C:\Users\user\Desktop\folder\* /public_html/upload
Compo
  • 34,184
  • 4
  • 22
  • 36
David
  • 59
  • 1
  • 2
  • 6

1 Answers1

0

I assume that you use (Win32-)OpenSSH sftp. It does not have any way to provide a password, on purpose.

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846