Menu Content/Inhalt
Home arrow Howtos arrow Windows Command Line Tips arrow Howto: Create file lists using the Windows command line
Howto: Create file lists using the Windows command line Print E-mail
Written by Josh   
Friday, 10 November 2006

HOWTO:

Create file lists using the Windows command line

Say you have a directory with files and sub directories you would like to list and have saved to a text file.  Try the following command from a Windows command line:

Step 1:  Click on start, then run.  Type in "cmd" (without quotes) and hit enter.  You should now be at the command line.
Step 2:  Type in "dir /s /ogn c:\directorywithfilestobelisted\ > c:\filelist.txt"  (without quote) and hit enter.
Step 3:  Type in "exit" to close the command line.  Your file list should now be in c:\filelist.txt.  Browse to it using My Computer.
Step 4:   (optional)  If you do not want to type in that full command each time, you can safe it to a .bat file.  Open notepad, then type in the dir command above.  Save the file as "filelist.bat" or whatever you want to call the file.  Just make sure .bat is on the end.  Also make sure you change the file type to all files to prevent the file from being saved as "filelist.bat.txt".

That's it.  The filelist is sorted by sub-directories first, files and sub-directories sorted alphabetically. 

Last Updated ( Saturday, 29 December 2007 )
 
< Prev