Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Re: Printing contents of directory to file to prin  (Read 4374 times)

0 Members and 1 Guest are viewing this topic.

sky

  • Guest
Re: Printing contents of directory to file to prin
« on: May 03, 2004, 12:55:02 PM »
go to c prompt, type :
dir > dirfile.txt

dir will list the dir, > will redirect the output to a txt file. u can print the txt file. pretty neat trick ; p

Munchausen

  • Guest
Re: Printing contents of directory to file to prin
« Reply #1 on: August 28, 2004, 06:07:50 PM »
I've been experimenting with the "TREE" and the "DIR" commands to create a text file on my hard drive listing the following details and information about a data DVD I created:

all the directories, subdirectories, complete long file names within each directory, sizes, and dates they were last accessed. However, the best set of commands and parameters I've been able to devise is:  

F:\DIR /A /N /P  > e:\DVD_contents.wpd

which lists (in a text file) directory and file information from left to right in the following order:

date, time, if a directory it lists <DIR> followed by the directory name; if NOT a directory it lists the file size, then file name.

For example, it looks something like this:

08/22/2004  04:49 PM <DIR> Smith
01/30/1848  06:14 AM  30,474 Addresslist.wpd

I know the date is goofy, but that's what shows up in DOS when I'm trying to do this. I also know that my hard drive is E, rather than C. That happened when I took my computer in for repair. Anyway, those aren't things I care to worry about right now. I want to learn how to create a text file listing details about the directories, subdirectories and files on a data DVD such as the following:

Directory names, subdirectories if any, followed by a list of all files in each directory (or subdirectory), followed by their sizes, dates (with full four-digit year) and times.

Can anyone assist me please?

Munchausen

  • Guest
Re: Printing contents of directory to file to prin
« Reply #2 on: August 31, 2004, 12:41:57 PM »
Thank you for your response. I am grateful.  However, I may have confused you and for that I apologize. The ".txt" extension is, in my case, the same as the ".wpd" extension because the latter is a WordPerfect file format.

That said, your instructions only provide directory names and files that are in the root directory and not in any directory. For example, here is what I get when I employ your instructions:

08/21/2004  09:33 PM    <DIR>          Bradbury
08/22/2004  04:49 PM    <DIR>          Morgan
01/08/2004  01:49 AM    <DIR>          Smith
01/30/2004  06:14 AM            30,474 Ra.wpd
03/12/2004  03:57 AM         23,100 AD.wpd

What I want is the following:

<DIR>      Bradbury      08/21/2004      09:33 PM
<DIR>      Morgan      08/22/2004      04:49 PM
<DIR>      Smith      01/08/2004      01:49 AM    
30,474       Ra.wpd      01/30/2004      06:14 AM
23,100      AD.wpd         03/12/2004       03:57 AM

And I want the listing of all subdirectories and their contents beneath each <DIR>.

With that additional information, is there a way to accomplish this with DOS?

Thank you in advance.