Topic "Automate a 'Y' when Prompt by: (Y)es, (N)o, C(a)ncel, (C)opy"

Author Message
byte711
[View user's profile]

Joined: 2011-10-27
Posts: 2
I sometimes have to upload a file from my Windows computer to a bunch of our Unix servers. I use the the following syntax to do this: "c:\Program Files\WinSCP\winscp.com" /command "open ""USERID:PASSWORD@HOSTNAME/var/tmp""" "put ""c:\temp\FILE.tar.gz" "exit"

I'm prompt for each winscp command with, '(Y)es, (N)o, C(a)ncel, (C)opy' in DOS on my Windows computer. Is there a way in the winscp.com command line I can have it default to -> Y ?

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
What is the prompt?

Also see:
https://winscp.net/eng/docs/scripting#using_scripting
https://winscp.net/eng/docs/scriptcommand_option
_________________
Martin Prikryl
byte711
[View user's profile]

Joined: 2011-10-27
Posts: 2
I have a stack of commands in a .bat file to upload a file from my Windows computer to a Unix server via winscp command, ie:
"c:\Program Files\WinSCP\winscp.com" /command "open ""USERID:PASSWORD@HOSTNAME001/var/tmp""" "put ""c:\temp\FILE.tar.gz" "exit"
"c:\Program Files\WinSCP\winscp.com" /command "open ""USERID:PASSWORD@HOSTNAME002/var/tmp""" "put ""c:\temp\FILE.tar.gz" "exit"
"c:\Program Files\WinSCP\winscp.com" /command "open ""USERID:PASSWORD@HOSTNAME003/var/tmp""" "put ""c:\temp\FILE.tar.gz" "exit"
(... and so on ...)


I'm prompt for each HOSTNAMExx to enter either:
'(Y)es, (N)o, C(a)ncel, (C)opy'

I have to manually enter 'Y' (without the single quotes) for each winscp.com that is executed in the DOS .bat file. How can I automate the 'Y' for each winscp.com in the .bat file?

I sometimes have hundreds of servers I need to upload a file (ie: a Unix install tar file) to. Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Please read documentation:
https://winscp.net/eng/docs/scripting#hostkey
_________________
Martin Prikryl
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