Topic "using get with variable name is not working"

Author Message


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 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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
Martin Prikryl

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License