set LOGINAS=username:password@host
set SOURCE_PATH=/local/home
set DEST_PATH=d:\Test\
set SCRIPT_FILE=script.txt
set _Date=%date%
If "%_Date%A" LSS "A" (Set _NumTok=1-3) Else (Set _NumTok=2-4)
:: Default Delimiter of TAB and Space are used
For /F "TOKENS=2*" %%A In ('REG QUERY "HKCU\Control Panel\International" /v iDate') Do Set _iDate=%%B
For /F "TOKENS=2*" %%A In ('REG QUERY "HKCU\Control Panel\International" /v sDate') Do Set _sDate=%%B
IF %_iDate%==0 For /F "TOKENS=%_NumTok% DELIMS=%_sDate% " %%B In ("%_Date%") Do Set _fdate=%%D%%B%%C
IF %_iDate%==1 For /F "TOKENS=%_NumTok% DELIMS=%_sDate% " %%B In ("%_Date%") Do Set _fdate=%%D%%C%%B
IF %_iDate%==2 For /F "TOKENS=%_NumTok% DELIMS=%_sDate% " %%B In ("%_Date%") Do Set _fdate=%%B%%C%%D
Set _Today=%_fdate:~0,4%%_fdate:~4,2%%_fdate:~6,2%
set COPYFILE_1_PATRN=A1_TEST_%_Today%.txt
set COPYFILE_2_PATRN=B1_TEST_%_Today%.txt
Echo option batch abort>>%SCRIPT_FILE%
Echo option confirm off>>%SCRIPT_FILE%
Echo open %LOGINAS%>>%SCRIPT_FILE%
Echo cd %SOURCE_PATH%>>%SCRIPT_FILE%
Echo option transfer binary>>%SCRIPT_FILE%
Echo get %COPYFILE_1_PATRN% %DEST_PATH%>>%SCRIPT_FILE%
Echo get %COPYFILE_2_PATRN% %DEST_PATH%>>%SCRIPT_FILE%
Echo close>>%SCRIPT_FILE%
Echo exit>>%SCRIPT_FILE%
"C:\Program Files\WinSCP\winscp.exe" /console /script=%SCRIPT_FILE%
DEL %SCRIPT_FILE%
PAUSE