Output a List of Folder Contents to a Text File in Windows

From Command Prompt

  • Change the Drive – “F:”
  • Set the directory – “cd ” Paste Folder Directory you want to Export the list from, as follows:
  • (the two steps above can be done in reverse order to get the same result)

cd F:\”Kalani’s Folder\Kalani’s Stuff”\ContentsList.txt

  • Use ” ” around Directory after pasting location from Explorer Window’s Navigation Bar, by hitting “Home” & “End” after Pasting to get to beginning & end
  • Type the Directory Command dir> and add a file name to the directory with a .txt extension, as follows:

dir>F:\”Kalani’s Folder\Kalani’s Stuff”\ContentsList.txt

  • Saved File Name cannot have any Spaces
  • Type /b at the end for basic view with names only
  • Type /o to sort by order, Alphabetically o:n, by Extension o:e, by Size o:s, by Date o:d, Directory o:g
  • you can set them in order, such as first by Directory, then by Extension, then by Name, such as o:gen

Final Command may look like this:

dir>F:\”Kalani’s Folder\Kalani’s Stuff”\ContentsList.txt /b /o:gen

From Batch File

  • Open Notepad
  • CD\Documents and Settings\username\My Documents (directory you want to extract information from)
    • dir > c:\mydocuments.txt (name and location of list to export)
    • start c:\mydocuments.txt (begin/open)

Adding Batch to Right-Click Shell Menu

  • Open Notepad
  • Type in the following: dir /a /b /-p /o:gen >FileList.txt
  • Save as FileList.bat in D:
  • Open a Folder
  • Menu>Tools>Folder Options…
  • Click “File Types”
  • Click “Folder”, (NOT “File Folder”)
  • Click “Advanced
  • Click “New”
  • Under “Action”, type “Create File List”
  • Under “Application Used”, Browse to your BAT file
  • Click ok, ok, ok to close everything
  • Right-Click a folder and go to “Create File List” to generate a listing of all files in the folder

(if no folder exists, you may need to create a new folder in the directory you want a listing for, in order to have a folder to click on)

To remove the item from the menu list, you must:

  • Run Regedit, and go to:
  • HKEY_CLASSES_ROOT\Folder\shell\Create_File_List
  • Delete the “Create_File_List” key in the left pane
  • Close regedit and reboot the computer to complete removal.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s