List files in a folder

One of the things you cannot normally do in Windows is to open a folder and then copy and paste the list of subfolders and files into a text document. However, in the last month alone 3 people have asked me how to do it.

Well, I thought I might share this little routine that allows you to do exactly that, i.e. print a list of files and folders (not a picture of a list, but an actual editable list). What this will do is create a new file called folderlist.txt within whichever folder you wish.

This new text file contains a list of all the folders and files below the folder where it resides.  This can be cut and pasted into Word or any other place you might need it.

How to make an editable list all the files inside a folder

To create the folderlist file, you need to do the following.

  • Open notepad
  • Enter the following single line exactly as shown below:
  • dir /a /-p /o:gen >folderlist.txt
  • save the file as listit.bat in the folder you want to copy
  • close notepad, navigate to your folder and click on the listit.bat file

Now a new file called folderlist.txt will magically appear in the folder. Open it and there will be a complete cut and pasteable list of folders,files, sizes and dates.

I suggest you keep a copy of the lisit.bat file somewhere safe so you can just copy it to any folder you want to list at any time in the future.