Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a folder full of media that I want to export to a list (csv, doc, xml, whatever...). When I navigate in Command Prompt to that folder, I can use dir to display the files in that directory. I want to export that list. How can I do this from command prompt?

Also is there an alternative way (built-in) to do it without command prompt?

share|improve this question

3 Answers 3

up vote 9 down vote accepted
dir > textfile.txt

will export (pipe) it to a plain text file. You can do whatever you want with it afterwards.

If you wish to append, use two >>'s

dir >> textfile.txt

If you wish the file to be in another directory, just use

dir > c:\temp\textfile.txt

Without timestamp

dir/b

for example ?

share|improve this answer
    
can I append to that file? and how do i define the location if i don't want it to be in that directory? Also, can I get the file to display the results without timestamp? –  GiH Oct 31 '09 at 1:41
    
How to do reverse of this? Having a list in the text file and only those files form a mixed bag folder? –  Rish May 9 '13 at 9:27

Try that utility File Names Export

It is very small and requires no installation.

share|improve this answer
1  
Please add some summary, the link might break any time. –  vonbrand Apr 27 '13 at 13:25

Easy!

dir > list.txt

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.