1

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?

1 Answer 1

2

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

2
  • 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 Commented Dec 24, 2012 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
    Commented Dec 24, 2012 at 15:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .