Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: using get with variable name is not working

Crosspost.
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