Solved

How to export the list of files in a folder exported to a text file?

Posted on 2012-03-10
3
307 Views
Last Modified: 2012-04-14
I want to print out a list of files in a folder in to a text file, so can print the list for my an inventry record of my files.  How do I do that?
0
Comment
Question by:shyam1944
3 Comments
 
LVL 52

Expert Comment

by:Bill Prew
ID: 37706019
If you want the files plus their size and date information just do:

DIR c:\dirname\*.* > "c:\save\log.txt"

If you want just a bare list of the file names then you can do:

DIR /b c:\dirname\*.* > "c:\save\log.txt"

These will list all files in the c:\dirname folder, and save the results to the "c:\save\log.txt" file.  Naturally, change the names as needed.

This command could be executed at a DOS command prompt,or in a BAT file.

To see other options on the DIR command you can do:

DIR /?

~bp
0
 
LVL 70

Accepted Solution

by:
garycase earned 500 total points
ID: 37706207
While you can, as noted above, do this with a simple command line entry with the output directed to a text file (or printer) ,  you'll get FAR more flexibility by using a small utility designed to format and print directories.

This is a very nice free one:  http://www.karenware.com/powertools/ptdirprn.asp

... or you can look at Glenn Alcott's "Directory Printer" [Not free, but it adds a few features Karen's doesn't have]  http://www.galcott.com/index.htm
0
 
LVL 11

Expert Comment

by:paultomasi
ID: 37706397
In it's simplest form, shyam1944 needs:

    DIR /B >filename

where filename is the name of the output file. This will create a list of files in the current folder.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now