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.

Just wondering how Windows determines file ordering when running a "dir" command (without any arguments) in a command prompt.

I know you can explicitly specify an order, but just curious how ordering works when no parameters are used. (I have a home stereo which can read songs from a usb drive, and it seems to play songs in the same order as that seen when I run a "dir" command on a windows XP command prompt. If I can figure out how the ordering works in a vanilla "dir" command, I might be able to control the play order of the songs on the stereo by changing certain attributes of the files).

share|improve this question

migrated from stackoverflow.com Sep 30 '12 at 19:01

This question came from our site for professional and enthusiast programmers.

1  
Which version of Windows? What filesystem on your USB drive. My dir lists in alphabetical order. –  David Heffernan Sep 30 '12 at 14:49
    
@David: Same for me in my Win7Home –  abatishchev Sep 30 '12 at 17:03
    
@DavidHeffernan: Windows XP. USB is FAT formatted. –  Moe Sisko Oct 1 '12 at 4:06

1 Answer 1

up vote 2 down vote accepted

dir (without arguments) command always shows files/dirs unsorted, in other words - in same order, as files/dirs are located on disk. NTFS file system "sorts" files/dirs internally (simplifying).

Thought, you may copy files one-by-one to achieve preferred sorting on your player.

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.