HomeHelpSearchLoginRegister

Welcome, Guest. Please login or register.
October 22, 2014, 04:39:52 PM

Login with username, password and session length
Search

News
Hark!
It's invitation only!

Stats
146 Posts in 122 Topics by 3 Members
Latest Member: Anatis
+  Shnarf
|-+  Hooray!
| |-+  Bits and Pieces
| | |-+  How To Print a Directory Tree to Text (DOS)
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Topic: How To Print a Directory Tree to Text (DOS)  (Read 5724 times)
Anatis
Guest
« on: January 30, 2008, 12:49:59 PM »

[size=18]How To Print a Directory Tree to Text[/size]

Let's assume you want to print a directory listing for drive C. First, create a text file--for example, C:\My Documents\DirListing.txt--from this listing. Select Start, Programs, MS-DOS Prompt, and type the following command line:

dir C:\ /S > C:\DirListing.txt

(Note: The /S switch searches all folders and sub-folders.) Close the MS-DOS Prompt window and open the .txt file you just created in your word processor. (Don't use Notepad--it can't handle large files.) From there, just print the file as you would any other document. The nice part is you have access to all of that program's commands, such as page breaks.

(Tip: To print a listing of only one folder, as opposed to an entire drive, type its path after the C:\ in the above command line.)

Assuming you want to print a listing of drive C by creating the text file C:\My Documents\DirListing.txt, open an MS-DOS Prompt window and use the following command line:

dir C:\ /S > C:\DirListing.txt

Would you prefer to send that information directly to the printer (for example, if you don't need to manipulate the information using your word processor's commands)? Exit to a DOS prompt, type

dir C:\ /S > prn

and press Enter.

(Tip: To print a listing of only one folder, as opposed to an entire drive, type its path after the C:\ in the above command line.)

OR: Let's assume you want to print a listing of drive C by creating the text file C:\My Documents\DirListing.txt, open an MS-DOS Prompt window, type

dir C:\ /S > C:\DirListing.txt

and press Enter. Then, in the last tip, I showed you how to send a directory listing directly to your printer: Follow the steps above, but use the following command line.

dir C:\ /S > prn

(Tip: To print a listing of only one folder, as opposed to an entire drive, type its path after the C:\ in the above command line.)

Now let's look at a couple of switches to help you customize your listing. (By the way, the /S switch in the above commands instructs DOS to search all folders and sub-folders.)

Want to print a listing of all the directories and subdirectories on the specified drive, without including all the files inside them? Use the /AD switch as follows:

dir C:\ /AD/S > prn

To print a detailed listing (for example, including long filenames) of all the files in a specified folder, without including that folder's sub-directories, use the /V switch as follows:

dir C:\{path to directory} /V > prn

(Tip: To add sub-directories and their files to this detailed listing, add the /S switch as follows:

dir C:\ {path to directory} /V/S > prn

And of course, if you want to send the information to a *.txt file instead of directly to the printer, just substitute the 'prn' in any of the above commands with the path and name of a TXT file, like so:

C:\DirListing.txt


I keep forgetting how to do it, so I'm finally dumping it here.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Amber design by Bloc | XHTML | CSS