I'm doing the following to list some of my favorite videos in a directory (I'm going to pipe them into a text file soon..)

for %i in (*avi *.mkv *mp4) do @echo %~ni

I'd like to alphabetically order the output of this command. I think I'd probably use sed or awk or something under Linux, but I'm on Windows 7 here using the command prompt (and soon, a batch file.)

How would I achieve this? (without using some external program or language)

Thanks! John.

link|improve this question

75% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Just add sort

(for %i in (*avi *.mkv *mp4) do @echo %~ni) | sort
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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