New
#1
DOS - list files in folders without path
I have a text file showing files in directories. The text file looks like this:
"C:\folderA\file1.zip"
"C:\folderA\folderB\folderC\file2.zip"
"C:\folderA\folderE\folderX\folderU\file3.zip"
The text file is created by using a batch file with this code segment:
Now, I wish to use the same directory tree and build a second text file with a list of the zip file names contained within, but I want to strip out the folder tree and just list the zip file names. And the zips are on different levels as the above example shows. As part of the solution, I would like to list just the file name and not the extension, like this (note the quotes which are intentional and should appear in the text file):Code:for /r %inpath% %%g in (*.zip) do echo "%%g" >> textfile.txt
"file1"
"file2"
"file3"
Thanks for looking and I appreciate any help.