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
- 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)
@echo Deleting c:dirListing.txt
- Name the file as Listdir.bat
- Save it in C:Documents and SettingsYour usernameSendTo. (see note)
- Now if you wanted to list the files in My music, right click on the folder
- Choose send to from the menu, then choose your file Listdir.bat
- Notepad will open with all the files in My music folder listed
- 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-
- 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.