I have a directory with several sub-directories and I am trying to get a list of the file names and their path, and then I would like to have this data in Excel. Is there a way I can do this with the command line in Windows 7?
Desired Excel result:
A1: FILENAME.JPG B1: X:\DIR1\DIR2\FIELNAME.JPG
That will produce the following in a directory named foo with files a, b and c:
So just pipe the output to a file then import that into Excel. You’ll have to do some manipulations in Excel to get the lines into two columns instead of rows, but that shouldn’t be difficult.
To pipe it correctly, you need to remember to pipe both dir commands and append to the file, like this: