Click here to Skip to main content
15,120,477 members
Articles / Operating Systems / DOS
Tip/Trick
Posted 6 Oct 2011

Tagged as

Stats

20.6K views
1 bookmarked

Print files list using DOS

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
7 Oct 2011CPOL
Printing files list(in a directory) using DOS

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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

thatraja
Web Developer
India India
No Biography provided

Comments and Discussions

 
GeneralRe: have my 5 - your tip works and is explained well - that's al... Pin
Reiss6-Oct-11 22:51
professionalReiss6-Oct-11 22:51 
have my 5 - your tip works and is explained well - that's all that should matter
GeneralReason for my vote of 5 More "common knowledge and available... Pin
iwdoofus10-Oct-11 20:07
Memberiwdoofus10-Oct-11 20:07 
GeneralReason for my vote of 5 Good tip... Pin
Pravin Patil, Mumbai7-Oct-11 9:29
MemberPravin Patil, Mumbai7-Oct-11 9:29 
GeneralGood point, changing mine Pin
ARBebopKid7-Oct-11 3:53
MemberARBebopKid7-Oct-11 3:53 
GeneralReason for my vote of 1 Should already be common knowledge a... Pin
ARBebopKid6-Oct-11 5:58
MemberARBebopKid6-Oct-11 5:58 
GeneralRe: Oh come on, any other reason for your down-vote? BTW I'll k... Pin
thatraja6-Oct-11 20:34
professionalthatraja6-Oct-11 20:34 
GeneralRe: IMO down voting should be used when something it wrong or ca... Pin
Reiss6-Oct-11 22:51
professionalReiss6-Oct-11 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.