Skip to Content
Custom Search

Generate list of files in a folder using DOS

 

Generate list of files in a folder using DOS 
 
There may be instances when you wish to generate a list of files
present in a folder.
 
The following DOS command can be useful in achieving the above
 
DIR *.* /S /B /A:-D
 
Where
 
/S - search sub folders 
/B - bare format, no summaries and headings 
/A:-D - no directories, files only
 
 
and to save the list we can redirect the result to another file.
 
 
The following command will generate a list of all the files in the
root folder and write to a file C:\list1.txt
 
 
DIR *.* /B /A:-D > C:\list1.txt
 
 
 
The following command will generate a list of all the files in the
root folder and all its subfolders and write to a file C:\list2.txt
 
DIR *.* /S /B /A:-D > C:\list2.txt
 
 
Lets look at the demo to understand the above steps.
 
 
 

Comments

Thanks

Thanks.. its working....

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 0 users and 27 guests online.
Dr. Radut | page