Need a help in transfer file to sftp server. We have a script with 3 stages.
Driver
ECHO off
path\file.sftp.sc.bat
Driver -file.sftp.sc.bat
@ECHO OFF
set PUTTY_HOME= LOCATION\ PUTTY
set PATH=%PUTTY_HOME%;%PATH%
REM ECHO %DOWNLOADDATA1%
set DOWNLOADDATA1="N"
IF EXIST LOCATION\"FileName.txt" SET DOWNLOADDATA1="Y"
ECHO %DOWNLOADDATA1%
IF %DOWNLOADDATA1% =="N" goto unsucc
ECHO %DOWNLOADDATA1%
ECHO GETTING DATA FILE
psftp -password -b LOCATION\Summary_LOC_SC.ftp user name
ECHO %ERRORLEVEL%
IF %ERRORLEVEL% EQU 0 LOCATION\ Success_email.vbs
goto end
IF %ERRORLEVEL% NEQ 0 LOCATION\UNSuccess_Email.vbs
goto end
:UNSUCC
ECHO %DOWNLOADDATA1%
ECHO UNSUCCESSFUL
LOCATION\UNSuccess_FNF_Email.vbs
:END
Driver-Summary_LOC_SC.ftp
cd/fall2014
1cd LOCATION OF FILE
put "File.Txt"
quit
Now, the file name is going to be changed with date, I mean, today it will be file20141118.txt, tomorrow will be file20141119.txt.
In the above script how to implement it, so it will pull up the current file.