I am trying to list all the newly added files of a directory to a text file using below code
but the code is not working properly. Can anyone suggest a solution, or correct the code to meet my requirements? I am using the
type command to delete last line of the Temp_File_List.txt file.
rem this batch script is used to list all the files created newly to a landing directory. set LandingDir=C:\Documents and Settings\Shivam\Desktop\LandingDir\*.txt set DateFile=C:\Informatica\PowerCenter8.6.0\server\infa_shared\SrcFiles\DateFile.txt set Temp_FileList=C:\Informatica\PowerCenter8.6.0\server\infa_shared\SrcFiles\Temp_File_List.txt set FileList=C:\Informatica\PowerCenter8.6.0\server\infa_shared\SrcFiles\File_List.txt set /P _PreviousDate=<%DateFile% xcopy "%LandingDir%" /l /s /d:%_PreviousDate% .>%Temp_File_List% type "%Temp_File_List%" | findstr /v File>%File_List% echo %date:~4,2%-%date:~7,2%-%date:~10,4% >%DateFile%