Difference between revisions of "Copy the filenames of a directory to a text file"

From OpenTutorial
Jump to navigation Jump to search
 
Line 1: Line 1:
= How to Copy the Filenames of a Directory to a Text Tile =
+
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.
 +
 
 +
= How to Copy the Filenames of a Directory to a Text File =
 
This tutorial will creat a text file containing the filenames of all the files in a directory.
 
This tutorial will creat a text file containing the filenames of all the files in a directory.
  
Line 39: Line 41:
  
 
{{todo|todonote=someone else has to write this 'cause I know very little about Macs}}
 
{{todo|todonote=someone else has to write this 'cause I know very little about Macs}}
 +
 +
= Bibliography =
 +
* Microsoft Windows Scripting Self-Paced Learning Guide by Ed Wilson (ISBN 0735619816)
  
  
 
[[category:command scripting]]
 
[[category:command scripting]]

Revision as of 19:02, 26 April 2006

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.

How to Copy the Filenames of a Directory to a Text File

This tutorial will creat 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

Example:

dir /b > c:\dir.txt

More info

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

dir /?


Macintosh Operating Systems

Bibliography

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