Home » Questions » Computers [ Ask a new question ]

Is there an application that can take a directory listing and write it to a file?

Is there an application that can take a directory listing and write it to a file?

A simple text file or csv will do.

Asked by: Guest | Views: 27
Total answers/comments: 4
Guest [Entry]

"Karen's Directory Printer can print the name of every file on a drive, along with the file's size, date and time of last modification, and attributes (Read-Only, Hidden, System and Archive)! And now, the list of files can be sorted by name, size, date created, date last modified, or date of last access. Of course you can save to file instead of printing.

Karen's Directory Printer is freeware.

Or run the DIR command from ColorConsole and then hit the button HTML or RTF

ColorConsole is freeware and portable.

The JR Directory Printer utility (another portable freebie) allows you to print a listing of every subdirectory and/or file contained within a directory and/or subdirectory.
It supports lowercase/dos style filename, file size in KB/bytes, attributes, custom file length, etc."
Guest [Entry]

"If you need a perhaps slightly 'prettier' version than if you used dir, you can do the following from the command prompt;

tree /f /a ""C:\Path\Of\Directory"" > C:\output.txt"
Guest [Entry]

"The answers already provided list what I was going to suggest initially, hopefully this answer will just solidify it:

tree /f /a

... which prints out a recursive tree of the directory listing, including files (/f), and using an ASCII output (/a).

Another option is the below, which will do a recursive (/s) listing in bare format (/b).

dir /s /b

This has the added plus that it lists the full path for the files. Obviously, if you leave out the /s switch, it will also just generate for the current directory.

You've already seen the output redirection as below, which redirects the standard output to the file:

dir /s /b>listing.txt

Also available is >> which appends the output to the file:

dir *.exe /b>listing.txt
dir *.config /b>>listing.txt"
Guest [Entry]

"You can install Cygwin and use the Unix tools:

ls -l > file.txt

This will create a file called file.txt containing the contents of the directory."