Directory Printing

J

Joe McGuire

WinXP Pro lets me print the listing of files in a directory (folder). But I
am more interested in using that list electronically, such as inserting it
in a document or e-mail. Is there a way to do so?
 
R

Rey Santos

Perhaps using the Print Screen key ( an image containing the list):
1. In Windows Explorer, open the folder, choose the list view of the files
and then press PRINT SCREEN to copy an image of the active window to the
Clipboard.
2. Click Start, point to Programs, point to Accessories, and then click
Paint.
3. On the Edit menu, click Paste to display the image.
4. On the File menu, click Save.
NOTE: If there are more files or folders than can be displayed in Windows
Explorer window (in other words, you must scroll to see all the files or
folders), you must scroll to view these files, and then repeat steps 1-4.
 
P

Pegasus [MVP]

Joe McGuire said:
WinXP Pro lets me print the listing of files in a directory (folder). But
I am more interested in using that list electronically, such as inserting
it in a document or e-mail. Is there a way to do so?

Try this:
1. Press Start / Run
2. Type the three letters cmd
3. Click OK
4. Type this command:
dir "c:\documents and settings\joe\my documents" | clip {Enter}
(replace the above with the correct folder name)
5. Open your EMail.
6. Click Edit / Paste
You now have a text version of the directory listing.
 
O

Olórin

Pegasus said:
Try this:
1. Press Start / Run
2. Type the three letters cmd
3. Click OK
4. Type this command:
dir "c:\documents and settings\joe\my documents" | clip {Enter}
(replace the above with the correct folder name)
5. Open your EMail.
6. Click Edit / Paste
You now have a text version of the directory listing.

This intrigued me so I tried it, and it didn't work - it seems it's only
native to Vista (and presumably Windows 7).

To make it work you need to have clip.exe in the Windows directory. One
download site is

ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/FILE/CLIP.EXE

(so it would seem to be old, part of the Windows 98 Resource Kit).

This page

http://www.winhelponline.com/blog/p...context-menu-in-windows-xp-and-windows-vista/

shows how to add Print Directory to the right-click context menu.
 
P

Pegasus [MVP]

Olórin said:
This intrigued me so I tried it, and it didn't work - it seems it's only
native to Vista (and presumably Windows 7).

To make it work you need to have clip.exe in the Windows directory. One
download site is

ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/FILE/CLIP.EXE

(so it would seem to be old, part of the Windows 98 Resource Kit).

This page

http://www.winhelponline.com/blog/p...context-menu-in-windows-xp-and-windows-vista/

shows how to add Print Directory to the right-click context menu.

I do run WinXP but I had not previously been aware that clip.exe is not
native to this operating system. Thanks for pointing it out.
 
V

VanguardLH

Joe said:
WinXP Pro lets me print the listing of files in a directory (folder). But I
am more interested in using that list electronically, such as inserting it
in a document or e-mail. Is there a way to do so?

Use the 'tree' DOS command. Open a command shell (cmd.exe) and run:

tree <parentfolder> > tree.txt

<parentfolder> is the parent folder whose subfolders you want to list. If
the path and/or folder name include spaces, you need to enclose it within
double quotes, like "c:\program files\microsoft office". You can use any
path and file name for the redirected output (treelist.txt was just an
example that would generate the file in the current folder). Any any
editor, like Notepad, to read the output file (and to print it or copy to
the clipboard).

If you don't like the appearance of upper-ASCII characters to show the
hierarchy, add the /a command-line parameter. For help, run "tree /?".
In fact, you could use one command line, like (all on one line):

tree /a <parentfolder> > _tree.txt && cmd /c notepad.exe _tree.txt && del
_tree.txt

Remember to double-quote the parentfolder if it contains spaces. You do the
'tree' command to list the subfolders. Its output gets redirected into a
file (that I preface with "_" to ensure its filename doesn't match on a
command). You load a new command shell (to pause command execution in the
current shell) and read the file using Notepad. When you exit Notepad, its
command shell unloads and the next command gets executed. The 'del' command
does cleanup so you're not left with a remnant file. Of course, you could
write a .bat or .cmd file that does the same thing, like a showtree.bat
batch file containing:

@echo off
tree /a %1 > _tree.txt
if not exist _tree.txt exit
notepad.exe _tree.txt
del _tree.txt

which you would call by entering "showtree <parentfolder>". Again, remember
to double-quote the folder name if it or the parh to it contains spaces.
If you don't want to always give the path to the showtree.bat file for
wherever you stored it (as in "c:\batch\showtree.bat <parentfolder>"), add
the folder where you stored it in the PATH environment variable (right-click
My Computer, Properties, Advanced, Environment Variables, add or update PATH
variable as a System variable so it is available to all user accounts), or
store the .bat file in a folder already searched, like c:\windows or
c:\windows\system32 although you are polluting the OS folders. I prefer to
create a C:\Batch folder where I save all my batch files and then add it to
the system PATH environment variable (at the head of that variable's value
so that folder gets searched first since I might create batch scripts that
mask internal or external commands). So my system PATH environment variable
looks like "PATH=C:\Batch;<otherfolders>". Then I can enter showtree
(although I typically include the extension, like showtree.bat, to ensure
that I mean a batch file instead of an executable, like showtree.exe) when
you want to run that batch file at a command prompt.

Normally I would add more to the above batch file for error checking and
ensuring a uniquely named output file but this one should suffice for you.
 
K

Ken Blake, MVP

WinXP Pro lets me print the listing of files in a directory (folder). But I
am more interested in using that list electronically, such as inserting it
in a document or e-mail. Is there a way to do so?


Here are four ways:

1. Go to a command prompt and issue the command

dir [drive:folder] > c:\tempfilename (you can use any name and put it
in any folder you want)

Then open notepad, open tempfilename, and print it from there.

Or if you want to insert it in a document or e-mail message, once
you're in notepad, instead of printing it, copy it, then paste it
where you want it.



2. Write (for example in Notepad) a 1-line text file:
DIR %1 /O >LPT1:

Save it as "printdir.bat" in the "Send To" folder.

Then, to print list of files in any folder, right-click that folder
and select Send to | printdir.bat

To include subfolders, change the comand to DIR %1 /O/S >LPT1:

3. Go to
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q321379 and
follow the instructions there.

4. Download and use any of the several freeware/shareware utilities
that can do this, such as the popular
http://www.karenware.com/powertools/ptdirprn.asp
 
J

Joe McGuire

Thanks! I tried Karen's but it seemed a bit awkward to me. I found a very
handy and simple one: JR Directory Printer at
http://www.spadixbd.com/freetools/jdirprint.htm. Does an excllent job.
Ken Blake said:
WinXP Pro lets me print the listing of files in a directory (folder).
But I
am more interested in using that list electronically, such as inserting
it
in a document or e-mail. Is there a way to do so?


Here are four ways:

1. Go to a command prompt and issue the command

dir [drive:folder] > c:\tempfilename (you can use any name and put it
in any folder you want)

Then open notepad, open tempfilename, and print it from there.

Or if you want to insert it in a document or e-mail message, once
you're in notepad, instead of printing it, copy it, then paste it
where you want it.



2. Write (for example in Notepad) a 1-line text file:
DIR %1 /O >LPT1:

Save it as "printdir.bat" in the "Send To" folder.

Then, to print list of files in any folder, right-click that folder
and select Send to | printdir.bat

To include subfolders, change the comand to DIR %1 /O/S >LPT1:

3. Go to
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q321379 and
follow the instructions there.

4. Download and use any of the several freeware/shareware utilities
that can do this, such as the popular
http://www.karenware.com/powertools/ptdirprn.asp
 

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

Top