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

Author Message


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:


winscp.exe /console /command "option batch abort" "option confirm off" "open s" "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.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
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

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License