Search This Blog

Wednesday 16 June 2010

Windows: List of filenames in folder

Click Start, then Run, and enter cmd—it's faster than digging for Command Prompt in the Start menu. Navigate to the folder in question using your good old DOS skills. This command will get you a list of filenames in sorted order: DIR /B /ON *.* > filelist.txt. The /B switch gives a Bare listing (filename only) and /ON means sOrt by Name. You will have to delete the name filelist.txt itself from the list.
If you're using Vista, this task is much easier. Select the files in Windows Explorer, hold Shift, and right-click them. Choose Copy as Path from the menu. Paste the list into whatever editor you prefer. You get the full pathname for each file, but a simple find/replace will clean that up if necessary.