upload a file dont work

Advertisement

tomislav91
Joined:
Posts:
1

upload a file dont work

Here is a simple script to my domain linux pc. I have winscp and in that folder i put my script that I should upload and script for uploading that (first) script to pc.
But when open it, nothing happend, no errors, no nothing. And it didnt copy. sftp is opened, and with win scp GUI i can upload.
Where is mistake?

This is my .bat script

open sftp://myuser:mypassword@192.168.1.21/
put skrpta.sh /home/Test/Desktop
exit

Reply with quote

Advertisement

jrp78
Joined:
Posts:
22
Location:
SoVA

Try passing the complete local path. I used c:\folder as an example.

open sftp://myuser:mypassword@192.168.1.21/
put c:\folder\skrpta.sh /home/Test/Desktop
exit

If that fails, try adding the following switches to your script.
open sftp://myuser:mypassword@192.168.1.21/
put c:\folder\skrpta.sh /home/Test/Desktop -nopreservetime -nopermissions
exit

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: upload a file dont work

tomislav91 wrote:

This is my .bat script

open sftp://myuser:mypassword@192.168.1.21/
put skrpta.sh /home/Test/Desktop
exit
How do you run this?
The above is not .bat (batch file), it's WinSCP script.
You have to run it using winscp.com, like:

winscp.com /script=upload.txt

Where the upload.txt is your ".bat script".

See also https://winscp.net/eng/docs/guide_automation

Reply with quote

Advertisement

You can post new topics in this forum