I need to create a list of files that is in a certain folder, and then outputting it in a .txt file and put it on my desktop. Is this possible with CMD and if so, how can I do this?

Windows 7 Home premium 64bit

link|improve this question

78% accept rate
Powershell is not an option for you? – squillman Mar 25 '11 at 18:38
I never used Powershell before. – kb67 Mar 25 '11 at 18:40
feedback

1 Answer

up vote 4 down vote accepted
dir/a/b/s path\to\folder > Desktop\files.txt

(Remove /a if you don't want to list "hidden" files.)

Alternatively,

tree/f > Desktop\files.txt
link|improve this answer
Thank you. tree/f is a shortcut to it? – kb67 Mar 25 '11 at 18:47
@kb67: No, tree is a different program - it lists files in a pseudo-graphical tree view. (tree lists only directories, tree/f includes files.) – grawity Mar 25 '11 at 18:49
Which one would you prefer? :) – kb67 Mar 25 '11 at 18:50
1  
@kb67: It depends on which format you want the list to be. Just run tree and dir/a/b/s and compare. – grawity Mar 25 '11 at 18:51
How do I specify the directory with tree – kb67 Mar 25 '11 at 18:55
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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