Topic "upload a file dont work"

Author Message
tomislav91
[View user's profile]

Joined: 2016-11-07
Posts: 1
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

Quote:
open sftp://myuser:mypassword@192.168.1.21/
put skrpta.sh /home/Test/Desktop
exit
jrp78
[View user's profile]

Joined: 2016-10-07
Posts: 16
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25786
Location: Prague, Czechia
tomislav91 wrote:
This is my .bat script

Quote:
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
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License