Directory listing into a txt file. How?

  • Thread starter Thread starter SliqM
  • Start date Start date
SliqM said:

In a command prompt window:

"dir "(note space) followed by drive letter and path followed by ">"
(redirects output to the file...) followed by drive, path and file name
where you want the listing and FINALLY press the "Enter" key. As usual
you WILL need a set of quotation marks around any drive/path/file name
combination that has ANY spaces.


Appending ">" and a destination file specification (including drive and
path if necessary) will sent the output of most command prompt commands
to the destination file. For most purposes the destination file
specification should have a ".txt" extension.

BUT!

For many purposes it would be simpler if you use a Windows based like
directory printer application which can also export directories to
spreadsheets like Excel.

From http://www.majusoft.de/DirPrinting/index_en.htm:

'DirPrinting is a simple program for viewing and printing directories.
It offers a drive/directory window and a file list, which can be
arranged and sorted according to various criteria. This list can be send
[sic] to any printer (printing preview and storage included). Functions
as "copy to clipboard", "save as file", "send by email", "include
subdirectories" or "file filter" are all available.'

"If you copy the list into the clipboard, you can paste it into any
application.
For example in Microsoft Excel:" (followed by a screen shot of a root
folder's directory listing in Excel)
 
Search your XP helpfile for the TREE command:
---------------
Tree
Graphically displays the directory structure of a path or of the disk in a
drive.
Syntax
---------------

For example, to list the structure of the C: drive
and put it into a text file named C_DRIVE.TXT

TREE C:\ /a > C:\C_DRIVE.TXT

If you want to see ALL the files (will result in a pretty big
..TXT file)

TREE C:\ /a /f > C:\C_DRIVE.TXT

As with all command line stuff, punctuation matters. Watch
those spaces.



RobertVA said:
SliqM said:

In a command prompt window:

"dir "(note space) followed by drive letter and path followed by ">"
(redirects output to the file...) followed by drive, path and file name
where you want the listing and FINALLY press the "Enter" key. As usual
you WILL need a set of quotation marks around any drive/path/file name
combination that has ANY spaces.


Appending ">" and a destination file specification (including drive and
path if necessary) will sent the output of most command prompt commands
to the destination file. For most purposes the destination file
specification should have a ".txt" extension.

BUT!

For many purposes it would be simpler if you use a Windows based like
directory printer application which can also export directories to
spreadsheets like Excel.

From http://www.majusoft.de/DirPrinting/index_en.htm:

'DirPrinting is a simple program for viewing and printing directories.
It offers a drive/directory window and a file list, which can be
arranged and sorted according to various criteria. This list can be send
[sic] to any printer (printing preview and storage included). Functions
as "copy to clipboard", "save as file", "send by email", "include
subdirectories" or "file filter" are all available.'

"If you copy the list into the clipboard, you can paste it into any
application.
For example in Microsoft Excel:" (followed by a screen shot of a root
folder's directory listing in Excel)
 
Several methods to accomplish this.......I like Tushar's best if importing to
Excel.

To add a "Print Directory" feature to Explorer, go to
this KB Article.

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q272623&

Or you can download Printfolder 1.2 from.....

http://no-nonsense-software.com/freeware/

I use PF 1.2 and find it to be more than adequate with custom
features.

OR Go to Command prompt and chdir to the folder with the files
Type DIR >MYFILES.TXT

All the above create a *.TXT file which can be opened in Notepad and printed.

One more method if you want to by-pass the *.TXT file and pull
directly to Excel is to use Tushar Mehta's Excel Add-in. This allows filtering
and sorting once you have the data in Excel.

http://www.tushar-mehta.com/ scroll down to Add-ins>Directory
Listing.

Download the ZIP file and un-zip to your Office\Library folder.


Gord Dibben MS Excel MVP
 
Thanks to you all, i using dirprint now, it does what i want. (full
filenames in a txt file)
Thanks again.

S.
 
In old days of MS-DOS, it was something like dir > directory.txt

I would think that still available in the Command Line Mode.

Not sure you can from GUI, except a PrintScreen, except PrntScn these days
doesn't do what the early functions of that button did.

These days it merely takes a screen capture of whatever's on the screen at
the current time, in early days it sent the screen's content to a printer
directly.
 
But without the spaces, as I recall.
Thus: dir>output.txt or dir>listing.txt (for example)
 
Bill in Co. said:
But without the spaces, as I recall.
Thus: dir>output.txt or dir>listing.txt

I recall it needing the spaces between "dir" and the rest
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top