Solved

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

Posted on 2012-03-10
3
306 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 51

Expert Comment

by:Bill Prew
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

762 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