Topic "How to change directory on both sides of the get command?"

Author Message
Orange

Guest


Hey everyone,

I'm trying to make a batch file that will connect to a sftp site, go into a folder, and copy the files there, which will then be copied into a directory located in a completely different area.

However when I tried to do this I wasn't able to get back out of the directory I pulled the file from.

Here is what I have been trying to use so far:

Code:

winscp.exe /console /command "option batch abort" "option confirm off" "open sftp://PlaceHolderName:PlaceHolderPassword@PlaceHolder.com" "cd /Path/Where/TheFile/Is/" "get TheFile.txt /Path/I/Need/To/Put/The/File/TheFileCorrectlyPlaced.txt" "exit"


Any help would be appreciated greatly, thanks in advance.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Sorry, I do not understand. Please try again, with some examples.
Anyway, note that the second argument to get cannot be a remote (*nix) path. It has to be a local path. Do you want to copy the remote file to another remote directory?
_________________
Martin Prikryl
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