Click here to Skip to main content
Click here to Skip to main content

Print files list using DOS

By , 7 Oct 2011
 

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)

About the Author

thatraja
Web Developer
India India
Member
Programmer | CodeProject MVP, Mentor | Author | Geek | Blogger | Bachelor | Dude
 
About him & his blog? check out here.
 
In Codeproject, he posted a blogpost & more than couple of Tip/Tricks, hope he'll write more soon. And he got a place in CCC table.
 
In programming, he wants to go with new things like HTML5, CSS3, WP7, Silverlight, WPF, WCF, etc.,
 
His hobbies are watching movies, Codeproject, being alone, etc.,

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralRe: have my 5 - your tip works and is explained well - that's al...memberReiss6 Oct '11 - 21:51 
GeneralReason for my vote of 5 More "common knowledge and available...memberiwdoofus10 Oct '11 - 19:07 
GeneralReason for my vote of 5 Good tip...memberPravin Patil, Mumbai7 Oct '11 - 8:29 
GeneralGood point, changing minememberUSABebopKid7 Oct '11 - 2:53 
GeneralReason for my vote of 1 Should already be common knowledge a...memberUSABebopKid6 Oct '11 - 4:58 
GeneralRe: Oh come on, any other reason for your down-vote? BTW I'll k...mvpthatraja6 Oct '11 - 19:34 
GeneralRe: IMO down voting should be used when something it wrong or ca...memberReiss6 Oct '11 - 21:51 

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

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130513.1 | Last Updated 7 Oct 2011
Article Copyright 2011 by thatraja
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid