I search up on internet to create a file list all the files and folders in a plain txt file as below code
Code: Select all
dir /b > fileslist.txt
Code: Select all
@echo off
cd C:\auto_pkg_build\Workspace\Build_pkg\T592-08878-0101_Link2500_TCPX_NARInfra_GEN_PROD\T592-08878-0101
if exist bottom_contents.txt (del bottom_contents.txt)
dir /b > bottom_contents.txt
if exist contents.lst (del contents.lst)
rename bottom_contents.txt contents.lst
- bottom_contents.txt
Contents.lst
Customer Download
Documents
Factory Download
- Contents.lst -> Directory contents (plain text)
Customer Download\ -> subdirectories
Documents\ -> subdirectories
Factory Download\ -> subdirectories
1) I need to remove the first line, bottom_contents.txt
2) I need to add after contents.lst -> Directory contents (plain text)
3) I need to add after subfolders -> subdirectories
4) if text file I also need to add after the file -> text file
One more big issue is that the above only list the current folder, I also need to list all the subfolders in which generate one of each contents.lst for each subfolders level....
The tool we have can generate contents.lst file but not command supported...
Any thoughts or suggestion?
Thanks