Command Line Upload

Advertisement

oneofmany
Guest

Command Line Upload

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 doesn't 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

Reply with quote

Advertisement

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 :
winscp "User:pw@Host" /command "put C:\File.txt /Home/" "exit"
this works,

but this (batch):
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 don't know why, the command is the same like the command i run in the shell.

Do you know why this happens?

Reply with quote

Advertisement

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 ?

Reply with quote

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?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
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.

Reply with quote

Advertisement

You can post new topics in this forum