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

Tagged as

Go to top

Print files list using DOS

, 7 Oct 2011
Rate this:
Please Sign up or sign in to vote.
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
Programmer | Dude | ||||||
 
About him & his blog? check out here. Currently he's updating the site, he'll return soon there with more things*.
 
In Codeproject, he posted a blogpost & more than couple of Tip/Tricks, hope he'll write more soon.
 
Favorite techs are MVC, WCF, Mobile, HTML5, CSS3, jQuery, etc.,
 
His hobbies are watching movies, CP, being alone, etc., But now he's working on something*.
 
* - SCAMP???
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
GeneralRe: have my 5 - your tip works and is explained well - that's al... PinmemberReiss6-Oct-11 21:51 
GeneralReason for my vote of 5 More "common knowledge and available... Pinmemberiwdoofus10-Oct-11 19:07 
GeneralReason for my vote of 5 Good tip... PinmemberPravin Patil, Mumbai7-Oct-11 8:29 
GeneralGood point, changing mine PinmemberUSABebopKid7-Oct-11 2:53 
GeneralReason for my vote of 1 Should already be common knowledge a... PinmemberUSABebopKid6-Oct-11 4:58 
GeneralRe: Oh come on, any other reason for your down-vote? BTW I'll k... Pinmvpthatraja6-Oct-11 19:34 
GeneralRe: IMO down voting should be used when something it wrong or ca... PinmemberReiss6-Oct-11 21:51 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 7 Oct 2011
Article Copyright 2011 by thatraja
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid