Topic "Having a problem downloading files using get command"

Author Message
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 10
Location: USA
I am trying to download files with the "Get" command. Instead of downloading files to the folder set in the "Directories" option, it downloads to the local folder where the program was run from. Below is the command I am using.

="C:\Program Files\WinSCP\WinSCP.exe /console /command ""option confirm off"" ""option batch off"" ""open FilesFolder"" ""get /users/clients/company/FromFolder/ " & "*%TimeStamp#yyyymmdd%" & ".txt"" -preservetime ""exit"" "

I would also like to have a command to rename the remote files and move them to a history folder on the remote server. They have already set me up a history folder and given me permission to move the files into the History folder.

Thanks for any help you can give.

dwvz2000
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Specify the target path in the second argument of the get command:

Code:
get /users/clients/company/FromFolder/ c:\targfet\path\

See https://winscp.net/eng/docs/scriptcommand_get
DWVZ2000
[View user's profile]

Joined: 2015-07-27
Posts: 10
Location: USA
Martin, Thank you very much for that help. One other question is; the "get" is getting the files in the base directory PLUS the subfolders in the base directory and the files in them. All I want to "get" are the files in the base directory but NOT the subfolders. How do I tell it to ignore the subfolders?
Thanks, David
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Please read documentation:
https://winscp.net/eng/docs/faq_script_non_recursive
Advertisements

You can post new topics in this forum

Search

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