vbscript to generate script file for Winscp
Posted on 2007-07-29
Can you help me with a vbscript for running a Winscp ssh session to a UNIX server to get some of the files to the local C drive?
I have 3 text files with list of servers.
the full path of the server location in the unix server is /drive/var/ex1/server01,/drive/var/ex1/server02,/drive/var/ex1/server03
the pull path of the server folder in the server is
REM This is the BAT file that we'll run in Windows.
REM It will compress a bigger file, upload all the selected
REM file to the remote server, and clean up the compressed file
REM Set some variables for locations to which we will refer in this
REM Call the WinSCP script with the necessary login info and you
REM will be prompted for a password.
"C:\Program Files\WinSCP\WinSCP.exe" /console /script=%scp_script_dir%"\winscp_script.txt"
where winscp_script.txt is as below
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open user:firstname.lastname@example.org
# Change remote directory
# Force binary mode transfer
option transfer binary
# Download file to the local directory C:\
get server-01.vmx c:\scripts\test.txt
# Exit WinSCP
I want to generate the winscp_script for the list of servers from each files and that should be used to run the winscp script