Copy the filenames of a directory to a text file

From OpenTutorial

Jump to: navigation, search

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.


Contents

[edit] Microsoft Operating Systems

[edit] 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.

[edit] 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

Example:

dir /b > c:\dir.txt

[edit] More info

For more information about the dir command type the following into your command window

dir /?


[edit] Macintosh Operating Systems

[edit] Bibliography

  • ( ISBN 0735619816 ) Microsoft Windows Scripting Self-Paced Learning Guide (Pro-Other)) Microsoft Windows Scripting Self-Paced Learning Guide by Ed Wilson




Bookmark this page on your favorite bookmarking site.
del.icio.us Reddit YahooMyWeb NewsVine Furl De.lirio.us digg blinkbits BlinkList blogmarks connotea Fark feedmelinks LinkaGoGo Ma.gnolia Netvouz RawSugar Shadows Simpy Smarking Spurl TailRank Wists
Personal tools
Promote OpenTutorial
Toolbox

feeds