Topic "Command Line Upload"

Author Message
oneofmany

Guest


Hi there,

i want to upload a specific file to a sftp server. I tried this with the command line Version of WinSCP. Getting connection to the server is not a Problem, but he doesnt upload. I tried following command :

-C:\Programs\WinScp\winscp.exe /console "sftp://User:pw@IP" /put "c:\Test\Test.zip /in/"

...and i tried /upload instead of /put, but with same result.

It would be very nice, if anyone can tell me the correct command to upload automatic a specific file.
I am using Version 4.0.6
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please read documentation.
oneofmany

Guest


thx it works now, but another Problem appears. I can run the command to upload in Dos-shell, but i fail to connect on the server with runnning the command in a batch.

Shell-command :

Code:

winscp "User:pw@Host" /command "put C:\File.txt /Home/" "exit"


this works,

but this (batch):
Code:

echo off
call "c:Programme\winscp\winscp" "User:pw@Host" /command "put C:\File.txt /Home/" "exit"
pause


I get the message : "Access denied" , but i dont know why, the command is the same like the command i run in the shell.

Do you know why this happens ?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Would this FAQ help?
_________________
Martin Prikryl
oneofmany

Guest


Thx for the answer. I will try to find out if this is the reason...
Guest




Hi, I made some tests to fix the Problem, but still without success.
When I Clean-up registry and I run the batch, it asks me for fingerprint, i type "yes" but still the same Problem : "No Authentification".

Strange : When I call the Batch without the pw, after the Username, I have to type the pw, and then it works. But why it doesnt work with the pw in the batch ?
oneofmany

Guest


ok i know why this doesnt work. I have a "^" in my pw, and the Batch makes "^" to "^^" and "^^" to "^^^^". So i think i cant use this special sign ? Dont I ?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
oneofmany wrote:
ok i know why this doesnt work. I have a "^" in my pw, and the Batch makes "^" to "^^" and "^^" to "^^^^". So i think i cant use this special sign ? Dont I ?

You can definitely use that from script file. It has probably some special meaning on windows command line. You can also URL-encode it, if you need to use command line.
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