Parameters for WinSCP Script
Hi Gurus,
I want to copy files from my local system to the server and vice versa. After the coping I want to mark this files so that the files will not be transfered twice.
To have all informations central in one file I created a .bat file to store the necessary infos in MS-Dos variables. (f.e.: the username, hostname, ...)
It works fine to use this info for the connect. But now I have the problem on how to pass the infos to the WinSCP script. :( (f.e.: the folder where the transmitted filed should be stored)
Is there any way to pass parameters to the WinSCP script?
Thank you for your help.
Cheers,Barbara
---------------------------------------------
set_transfer_env.bat <-- Script to set the infos centrally
@ECHO OFF
rem ---- Server to Local
SET IN_SCRIPT=get_file.txt
SET IN_USERNAME=oracle
SET IN_HOST=asbudemo.at.oracle.com
SET IN_LOCAL_PATH=D:\incoming
SET IN_SERVER_PATH=/home/oracle/ingoing
SET IN_FILE_NAME=Bankfile.dat
rem ---- Local to Server
SET OUT_SCRIPT=put_file.txt
SET OUT_USERNAME=oracle
SET OUT_HOST=asbudemo.at.oracle.com
SET OUT_LOCAL_PATH=D:\outgoing
SET OUT_SERVER_PATH=/home/oracle/outgoing
SET OUT_FILE_NAME=Bankfile.dat
-----------------------------------------------------
start_get_file.bat <-- Script to call WinSCP
call set_transfer_env.bat
winscp3.exe /console /script=%IN_SCRIPT% %IN_USERNAME%:%1@%IN_HOST%
if errorlevel 1 goto error
echo Download succeeded
exit
:error
echo Download failed
------------------------------------------------------------
get_file.txt <-- WinSCP Script
option batch on
option confirm off
option transfer automatic
get /home/oracle/incoming/Bankfile.dat d:\outgoing\
close
exit
I want to copy files from my local system to the server and vice versa. After the coping I want to mark this files so that the files will not be transfered twice.
To have all informations central in one file I created a .bat file to store the necessary infos in MS-Dos variables. (f.e.: the username, hostname, ...)
It works fine to use this info for the connect. But now I have the problem on how to pass the infos to the WinSCP script. :( (f.e.: the folder where the transmitted filed should be stored)
Is there any way to pass parameters to the WinSCP script?
Thank you for your help.
Cheers,Barbara
---------------------------------------------
set_transfer_env.bat <-- Script to set the infos centrally
@ECHO OFF
rem ---- Server to Local
SET IN_SCRIPT=get_file.txt
SET IN_USERNAME=oracle
SET IN_HOST=asbudemo.at.oracle.com
SET IN_LOCAL_PATH=D:\incoming
SET IN_SERVER_PATH=/home/oracle/ingoing
SET IN_FILE_NAME=Bankfile.dat
rem ---- Local to Server
SET OUT_SCRIPT=put_file.txt
SET OUT_USERNAME=oracle
SET OUT_HOST=asbudemo.at.oracle.com
SET OUT_LOCAL_PATH=D:\outgoing
SET OUT_SERVER_PATH=/home/oracle/outgoing
SET OUT_FILE_NAME=Bankfile.dat
-----------------------------------------------------
start_get_file.bat <-- Script to call WinSCP
call set_transfer_env.bat
winscp3.exe /console /script=%IN_SCRIPT% %IN_USERNAME%:%1@%IN_HOST%
if errorlevel 1 goto error
echo Download succeeded
exit
:error
echo Download failed
------------------------------------------------------------
get_file.txt <-- WinSCP Script
option batch on
option confirm off
option transfer automatic
get /home/oracle/incoming/Bankfile.dat d:\outgoing\
close
exit