I am trying to compile a list of all the files in four directories, each with a different path. I have the following code, and it is working, but not how I want it to
@echo off tree d:\directory > c:\lists\4list.txt /a /f tree e:\directory2 >> c:\lists\4list.txt /a /f tree f:\directory3 >> c:\lists\4list.txt /a /f tree g:\directory4 >> c:\lists\4list.txt /a /f
The output in 4list.txt has all the ASCII characters and spaces at the front of each line. It also has
+---Directory name filename1 filename2 filename3
listed at each directory in the tree. Is there any way that I can have it generate this list, WITHOUT all the special characters, directory names, spaces, extra lines, AND without the file extensions?
Basically, I am wanting to create this list of the 2200+ files, so I can copy and paste it into an Excel spreadsheet that I have conditional formatting setup on, that highlights duplicate filenames (may have duplicate video files, but with different formats .mkv, .mp4, etc.).
I know that I can manually go through the text file, and using Notepad's find/replace feature, I can "replace" all of the extensions with blank (""), and manually replace the extra characters and spaces at the beginning of each line as well as deleting the "+---Directory" names. However, this can be RATHER time consuming.
I am wanting to create this file, so that it can be scheduled to run once per day, and update the ever growing list of files on these drives.
If there's a way to have this list exported to an Excel document rather than a .txt file that would save me a step or two as well.