Description
Sometimes we want to print the list of files in a directory. Example: Print the songs list in a CD/DVD.
In DOS, using
DIR
command(with additional parameters), we can achieve this thing.
Syntax
To print the files list:
dir /b > prn
To save the list as a file:
dir /b > filename.txt
dir - Command
/b - Parameter. For bare format (Displays only file names. No heading information or summary).
Output
Now I'm executing this command in C Drive (on my system):
C:\> dir /b > CDriveFiles.txt
Now open the file
CDriveFiles.txt
to view the contents:
AUTOEXEC.BAT
CONFIG.SYS
Documents and Settings
Intel
Program Files
WINDOWS
Using other parameters of
DIR
command, you can change the output.
Further Reading
DOS Command: DIR[
^]