Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

Excel List Of Files in WIndows Explorer FOlder

I have a folder in Windows that has over 100 files in it.  I would like to get a text or Excel listing of the file names.  How can I extract the file names in a list?  Thanks.  - Tom
0
tomfarrar
Asked:
tomfarrar
  • 8
  • 5
1 Solution
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Hi Tom,
Open a command prompt (let me know if you don't know how to do that), go to the folder of interest (also let me know if you don't know how) and type:

dir *.*>filelist.txt

Hit Enter. This will give you a lot of info about the files. If you'd like just the file names and types, give it the /b option (stands for "bare"):

dir *.*>filelistbare.txt /b

Regards, Joe
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Tom,
Just in case you need instructions on how to open a command prompt and navigate to the folder, here they are:

Start menu
All Programs
Accessories
Command Prompt

You'll see a window that looks like this:
command promptIf your folder of interest is on the C drive, great; if not, type the drive letter followed by a colon and hit the Enter key. For example, if the folder is on the D drive, type

D:

in the command prompt window and hit Enter.

Now type this in the command prompt window and hit Enter:

cd \foldername

where foldername is the name of the folder you want the list for. You should now see in the command prompt window the drive letter and the folder of interest, such as this:
command prompt with drive and folderNow you're ready to do:

dir *.*>filelist.txt

or

dir *.*>filelistbare.txt /b

(followed by the Enter key)

The resulting text file with a list of your 100+ file names will go into the same folder. You may hit the red X in the upper right of the command prompt window to close it. Regards, Joe
0
 
tomfarrarAuthor Commented:
so here is what I did:

Went to Windows Explorer
Selected the folder I want a list of files from
Held down the shift key, and right-clicked the folder; selected "Open Command Window Here"
With the window open, and showing my folder path "like "MyPath"> follwed by a blinking curser
Typed: filelist.txt
Said command not recognized
Typed: filelistbare.txt/b
Said command not recognized

What am I doing wrong?  Thanks, Joe.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
tomfarrarAuthor Commented:
Here is the results of following your instructions, Joe.  Or, a least I think I did.  - TomEE-Doc.docx
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Tom,
Not just filelist.txt. The command is:

dir *.*>filelist.txt

Likewise,

dir *.*>filelistbare.txt /b

Regards, Joe
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Oh, I just looked at your document...there needs to be a space between dir and *.*
0
 
tomfarrarAuthor Commented:
Still not getting there yet.  Thanks for your patience, Joe.  See attachment.
EE-Doc.docx
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
You are there! The last three all worked correctly! You now have a file called [filelist.txt] in the folder [Z:\TieOut WIP]. Open up Notepad, browse to that folder, and load the file!
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Of course, the filename for the list can be whatever you want, such as [these_are_my_100_files.txt]. So then the command would be:

dir *.*>these_are_my_100_files.txt

And just put a /b on the end if you want only the bare file names:

dir *.*>these_are_my_100_files.txt /b
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Tom,
I'm sure the lack of any feedback when you issued the dir command is disconcerting, so I'll explain. The command

dir *.*

means to do a directory listing (dir) of all files (*.*). If you issue that in the command prompt exactly as shown above (dir *.*) you will see the results right there in the command prompt window. Try it...won't hurt anything...the 100+ lines with the file names in that folder will fly by quickly! But when you put the greater-than symbol (>) and a file name after the dir command, that means to direct all of the output from the command into that file. So even though it worked perfectly, you won't see a thing...it will simply come back to the next line waiting for your next command. In other words, because all of the output from the dir command went into a file, you didn't see anything! But I assure you it worked fine, which you will see as soon as you open the text file in Notepad. I hope that helps to explain what's happening. Regards, Joe
0
 
tomfarrarAuthor Commented:
Hi Joe - Thank you so much for the quick and comprehensive answer.  I had to bug out last night early so I didn't get a chance to get back with your quick responses.  ANyway, thanks again and I must say I have had some good answers here, but none as quick and comprehensive as yours.  - Tom
0
 
tomfarrarAuthor Commented:
Best response ever at Experts Exchange (and I have gotten many good responses).
0
 
Joe Winograd, EE MVE 2015&2016DeveloperCommented:
Tom,
You're very welcome. And thanks to you for the kind words – I truly appreciate it! Regards, Joe
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now