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'm trying to use DIR to list all files in the current directory and sub directories ordered alphabetically. I only care about the filepath and name. I don't want the size, counts, etc. Here's what I have but it's just too details:

dir/on/s/w/a-d > __files.txt

This outputs something like (obfuscated):

 Volume in drive Q is ********
 Volume Serial Number is ****-****

 Directory of Q:\****

__files.txt                    __listallfileswithoutput.bat
               2 File(s)             28 bytes

 Directory of Q:\****\*

*** ****.***           ******.***              ** **** ******.***
** **** ** ******.***   
               4 File(s)  4,288,735,526 bytes

 Directory of Q:\****\*

*********.***
 ...

I just want:

Q:\****\*\*** ****.***
Q:\****\*\******.***
Q:\****\*\** **** ******.***
Q:\****\*\** **** ** ******.***
Q:\****\*\*********.***

Can this be done with DIR alone? If not, how can it be done?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Is the output of dir/on/s/a-d/b > __files.txt what you expect?

share|improve this answer
    
Yes, that's exactly what I want. You should expand your answer to include the reasons why/how it works. FYI, I looked through the DIR help and completely overlooked /b! Thanks –  flem Dec 24 '12 at 15:56
    
Not sure what sort of reasons/explanation you're looking for, that a simple dir /? will not provide. /on sorts by name (alphabetic), /s is for dir recursion, /a-d omits dirs and /b is for a bare output format. The rest simply redirects the command's output to your chosen file. –  Karan Dec 24 '12 at 15:59
add comment

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.