Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: How to change directory on both sides of the get command?

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?
Orange

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

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 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.