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

Advertisement

Orange
Guest

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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?

Reply with quote

Advertisement

You can post new topics in this forum