Print a Listing of Files in any Directory or Drive Using the Windows Command Prompt

By | December 30, 2014
Print Friendly, PDF & Email

listprintPrint a Listing of Files in any Directory or Drive Using the Windows Command Prompt

Sometimes you may find it useful to print a list of files in a directory. And we know there are several software applications that perform this task. But you don’t have to download or install anything to create a directory listing – all you need is a little time and the command prompt.

Step #1:  Using Windows Explorer navigate to the directory (folder) which contains the files of which you which you wish to print a list. In the example below, we’ve navigated to our G:\ drive – because that’s the directory (folder; drive) we want to print a listing of:

Step #2: We put our cursor in the address line until just the just the Directory G:\ shows then type CMD over it (see below):

Step #3: Press “Enter” and the command prompt will open to G:\ drive. It does not have to be a drive; it could be any folder – like Pictures or Music or Program Files, capiche?

Step #4: With the command prompt opened to the directory we want to print we type the following command:

DIR G:\ > MY_DIRECTORY_LIST.TXT 

You don’t have to call your file MY_DIRECTORY_LIST.TXT you can call it anything you want – as long as the name has no spaces in it (and no special characters like $, &, %, etc.)

Step #5: Press “Enter”

You won’t see anything happen. But it’s time to look at your handiwork anyway. So navigate to the directory you want to print and you’ll see the text file you created above.

Locate the file you just created

Double-click to open it.

And there’s your text file – all ready to print (see below).

You can do this with any folder (directory) or drive. And though it looks like it’s a lot of work it took less than two minutes to print the directory list of drive G.

This tip works on Windows XP, Windows Vista, Windows 7, Windows 8.x, and Windows 10. Try it – you just might like it – and even if you don’t you’ve learned something new.

4 thoughts on “Print a Listing of Files in any Directory or Drive Using the Windows Command Prompt

  1. C Dickerson

    Another way to print the directory is download this file from Microsoft, it puts the command on the mouse right click menu, then right click on a folder scroll down to print folder for it to print out , saves going to CMD prompt every time, http://support.microsoft.com/kb/321379.
    Happy new year

    Reply
    1. infoave Post author

      There are many different ways to print a directory and we stated this in the article. There are tons of freeware programs you can download that will allow you print a directory. The purpose of the article was to show you that you don’t need any other software to print a directory – as well as the power of the command line.

      Reply
  2. shari carter

    Love your snowflakes, but it has taken me a couple of days to realize that they weren’t “spots” before my eyes! That learnt, I can now enjoy them.

    Reply
  3. Helga

    Gee, am I glad to read the comment from Shari ! I was doubting my eyes as well !!
    Besides that, I have been reading your news letter for years, and every time I do , I learnt something new, as you said in your last article.
    I am pretty old and so thankful, that you write in a way that even an old lady, or beginner can follow your instructions.
    Thank you so much.
    Helga

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *