What's new

how to create list of files in alpha order with dos command? (1 Viewer)

Kyle McKnight

Senior HTF Member
Joined
Mar 8, 2001
Messages
2,504
OK. I've got WinXP, and sometime a long, long time ago, someone sent me a DOS command to run from the cmd prompt to create a list of all my MP3 files located in a certain directory.

It listed in alphabetical order via subdirectories, then listed the files in order in each one.

Can anyone help?
 

Mark Dubbelboer

Screenwriter
Joined
Oct 6, 1999
Messages
1,007
dir/? will give you the options

i think what you want is
"dir/s/on"

/s shows directory and subdirectories
/on orders by name

hope that helps
 

Kyle McKnight

Senior HTF Member
Joined
Mar 8, 2001
Messages
2,504
Ya, I've tried so many different things, and just can't get the list to be alphabetical. I keep coming up with this. Thanks for the help though.
 

Brett_H

Second Unit
Joined
Oct 3, 2001
Messages
341
Kyle,

Try "dir /a-d /on /s /b"

"/a-d" excludes directories, which is what you want.
"/b" is "bare" format, just the names, no file sizes.

Hope this helps. (Note: I'm on Win2K, I'm hoping XP is similar since it's based on Win2K.)

-Brett.
 

Ted Lee

Senior HTF Member
Joined
May 8, 2001
Messages
8,390
is there a specific reason you want to do it from dos? i know i have some freeware app on my pc at home that will list all the files of any given directory and subdirectory if you specify. you can even export the data to excel, etc.

can't remember what it's called though...i can check when i get home if you're interested.

i did a quick search on cnet and came up with something like this which may also work:

http://download.com.com/3000-2248-10...ml?tag=lst-0-4

[edit] - can you take your txt file and import it into excel, then sort that way?
 

Christian Behrens

Supporting Actor
Joined
Mar 2, 2000
Messages
719
Location
SF Bay Area
Real Name
Christian Behrens
I use Brett's exact command as well when I need just filenames in alphabetical order. Only I would write them to a file:

dir /a-d /on /s /b > dir.txt

This was on NT, but as it works for Brett on W2K, I'd be surprised if it doesn't work on XP then as well.

-Christian
 

Kyle McKnight

Senior HTF Member
Joined
Mar 8, 2001
Messages
2,504
I don't know if it's something funky with my system or not. Running them from the command prompt, I keep getting the same thing I linked to above.

Ted, thanks for the link to that program. My computer must be stupid or something. Even when usuing that program, and telling it to put the files in ascending order, it still comes out the exact same way as I have linked above....doesn't even change when I tell it to go descending.

(here is link again)
 

Ken Chan

Senior HTF Member
Joined
Apr 11, 1999
Messages
3,302
Real Name
Ken
Maybe it's sorting on the short file names instead? In any given directory, try

dir /x /on

The short name is the second-to-last column. Are those sorted, but the long names (the last column) are not?

In any case, you should be able to sort by using the aptly named SORT utility:

dir /a-d /on /s /b | sort

or to put it in a text file:

dir /a-d /on /s /b | sort > someotherdirectorydir.txt

(If you don't put the text file in another directory, it gets included in the list you generate.)

//Ken
 

Ted Lee

Senior HTF Member
Joined
May 8, 2001
Messages
8,390
that's weird that it won't work even using that program.

heck...i guess if all else fails, copy your text file and export it to excel, then sort it. i did it and it sorted perfectly. :)

[edit] btw, the program i'm using is called max lister. works pretty well for me...
 

Users who are viewing this thread

Sign up for our newsletter

and receive essential news, curated deals, and much more







You will only receive emails from us. We will never sell or distribute your email address to third party companies at any time.

Forum statistics

Threads
357,063
Messages
5,129,879
Members
144,281
Latest member
papill6n
Recent bookmarks
0
Top