I have to transfer a file from one server to another. I log in to the first one with PuTTY and then type this:
sftp -v -oIdentityFile=path username@host
cd path
put file
Everything works perfectly! Now I'm trying to do it with a batch file. In the .bat I have:
putty.exe -ssh host1 -l username1 -pw password1 -m script.txt
In the script.txt
file:
sftp -v -oIdentityFile=path username2@host2
cd path
put file
exit
It connects to the server number two but then it stops. The prefix sftp>
does not appear and it does not read the following lines. Do you have any suggestion?