Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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
jrp78

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
tomislav91

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