How to create a list of filenames from a directory and send it to notepad to save or print

Free Computer Help By Mitz

Have you ever wanted to see a list of files or folders that are contained in a particular directory. I have. One day I decided that it would be great to have a list of the files from my music folder. But then I discovered that Windows does not have any tools to do this. So here is a fantastic, sneaky batch file that you can create to do the job for you. If you are not familiar with Batch files, you will be soon. Once you have made one, and see that it is successful, and working, they can become very addictive.

Please check out some very simple Batch Files before trying this one.

How to create a list of filenames from a directory and send it to notepad to save or print

  1. Paste this text below into notepad

@echo Dumping directory listing to c:\dirListing.txt
@echo        (This may take some time for large directory trees.)
@REM the /A switch lists all hidden and system files as well.
@REM the /S switch lists all subdirectories and their contents.
@dir %1 /A /S > c:\dirListing.txt
@echo Opening c:\dirListing.txt in Notepad (Close notepad to delete file)
@notepad c:\dirListing.txt
@echo Deleting c:\dirListing.txt
@del c:\dirListing.txt
@pause

  1. Name the file as Listdir.bat
  2. Save it in C:\Documents and Settings\Your username\SendTo. (see note)
  3. Now if you wanted to list the files in My music, right click on the folder
  4. Choose send to from the menu, then choose your file Listdir.bat
  5. Notepad will open with all the files in My music folder listed
  6. Now you can save or print this file.

To get this script to work on Windows Vista see this post on the forum A batch file to make a directory list for Windows Vista-

Notes:

  • The send to folder may be hidden by Windows. Here’s how to show hidden files.
  • Windows has no other way available to make a list of filenames that are in a directory or folder on your computer.
  • To print your list simply select print form the file menu at the top of notepad.

Related Posts

About Mitz

Hi guys...I am a computer freak but I do not always talk in tech language. Hope you enjoy my website and learn everything you need to know in an easy to understand way.. If you like what you see please join: Follow Tips4pc On Twitter | Become A Facebook Fan | Subscribe RSS Feed | Tips4pc Youtube Channel
This entry was posted in Other articles and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>