Solved

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

Posted on 2012-03-10
3
311 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 55

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

An article on effective troubleshooting
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

729 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