using get with variable name is not working

Advertisement

Guest

using get with variable name is not working

Hi

My requriment is to take the latest file from remote and store it in loacl. The file name is appended with date.
exp: abc01022009.txt.

i am using the below script

@echo off


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Find the Current date MMDDYYYY
::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

for /F "tokens=1-4 delims=/ " %%i in ('date /t') do (
set DayOfWeek=%%i
set Month=%%j
set Day=%%k
set Year=%%l
)
echo %Month%
echo %Day%
If %Month% LEQ 9 Set LMonth=0%Month%
If %Month% GEQ 10 Set LMonth=%Month%
If %Day% LEQ 9 Set LDay=0%Day%
If %Day% GEQ 10 Set LDay=%Day%

set fname = abc_%LMonth%%LDay%%Year%.TXT

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: Copying the BPD Gun Offender Registry files from FTP server * * *
cd C:\Program files\WinSCP
winscp.com biftp@ftpe:22 /command "lcd C:\backup" "get fname" "exit" /privatekey="C:\keyfiles\id.ppk"

I am not able to get the file name.

Please help to achive this

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum