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

Advertisement

byte711
Joined:
Posts:
2

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

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

Reply with quote

Advertisement

byte711
Joined:
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!

Reply with quote

Advertisement

You can post new topics in this forum