Copy the filenames of a directory to a text file
This tutorial explains How to Copy the Filenames of a Directory to a Text Tile This can be useful if you are trying to create a catalog of files that you have. If you want to share with others via email or html the contents of a particular directory. This tutorial explains how to do this under a variety of operating systems from Microsoft to Macintosh to Linux.
This tutorial will create a text file containing the filenames of all the files in a directory.
Microsoft Operating Systems
Get to a Command Prompt
For Windows 9x and ME above - goto start/run and type command into the box and hit enter
For windows 200, NT, XP - goto start/run and type cmd into the box and hit enter
Windows 3x - I don't remember but there should be an icon somewhere in Program Manager labeled "MSDOS Command Prompt" or something similar
DOS - That's just silly, you're already there.
Type the Command
Make the directory with the files you want the current directory.
Use the Following Command
dir /b > dir.txt
This will perform the dir command with the bare formatting switch. Creates a file named "dir.txt" and puts the output of the dir command into it.
Note: This example will also include the dir.txt file in the list. If this if not acceptable then change the path for dir.txt in the command
dir /b > c:\dir.txt
For more information about the dir command type the following into your command window
Macintosh Operating Systems
Linux (*nix) Operating Systems
From a terminal
ls -1 > dir.txt
- (ISBN 0735619816) Microsoft Windows Scripting Self-Paced Learning Guide by Ed Wilson