1
如何将目录中所有新添加的文件列入文本文件?
我试图使用下面的代码列出目录中所有新添加的文件到文本文件 但代码不能正常工作。任何人都可以建议解决方案,或更正代码以满足我的要求?我正在使用 type 命令删除Temp_File_List.txt文件的最后一行。 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%