Topic "Custom command to download remote selected file to a specific local directory"

Author Message
onirix
[View user's profile]

Joined: 2017-04-14
Posts: 2
Hello,
I’d like to have a custom command to download a copy of a remote file to a predefined local path.
In a second time I’d like to add a prefix to the copied file with "VM-".

Here is my command that does not work :

Code:
winscp /command get !& c:\Users\myName\Desktop\TEMP\


I join screens

Thx for your help ! Cool
2017-04-14 11_08_55-Editer une commande.png (30.6 KB)

Description: Custom command editing

2017-04-14 11_08_55-Editer une commande.png

2017-04-14 11_07_44-configuration - VM EGSI - WinSCP.png (33.47 KB)

Description: Context menu

2017-04-14 11_07_44-configuration - VM EGSI - WinSCP.png

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26138
Location: Prague, Czechia
I assume that this is your question:
https://superuser.com/q/1200472/213663
onirix
[View user's profile]

Joined: 2017-04-14
Posts: 2
Thanks a lot Martin for your response.

I didn’t found this post on SuperUser website!
So the only way to script something like that using the is to get command is to go through by the WinSCP console, isn't it ?

Can I send a parameter like the file to download from the contextual menu to the console ?

It’s much complex that I’ll think at the first sight Confused
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26138
Location: Prague, Czechia
I really though that's it's your question.
But now I see that it somewhat different.

What you are trying is the right approach, but you also need to open the session. And your syntax is wrong.

winscp /command "open !S" "get !& c:\Users\myName\Desktop\TEMP\*" "exit"

See
https://winscp.net/eng/docs/guide_custom_commands_automation
https://winscp.net/eng/docs/commandline
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