There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tech Tips & Tricks
Tag Cloud
access acer asus bios bsod computer crash driver drivers error ethernet excel freeze games gaming gpu hard drive hardware hdmi internet java laptop malware memory monitor motherboard music network obp printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > General Technology > Tech Tips & Tricks >
How to Create a File List at a Command Prompt

Reply  
Thread Tools
pyritechips's Avatar
pyritechips has a Photo Album
Computer Specs
Community Moderator with 24,368 posts.
 
Join Date: Jun 2002
18-Jan-2004, 09:29 AM #1
How to Create a File List at a Command Prompt
Have you ever wanted to print out a list of files in a folder? This handy trick will generate a text file of the contents of any folder on your computer. When generated it will look like this:



I got this from the Windows Family, W98se section but it works great in W2K also. I used this to print out a list of what is on the CDs i used to back up all my files. Much easier than hand writing or typing out the names of a thousand picture files!
- - -

1. Click Start, point to Programs, and then click MS-DOS Prompt (or Command Prompt in Windows NT).

2.At a command prompt, locate the drive that contains the folder whose contents you want to list. For example, if you want to create a text file that contains a list of the contents of a folder on drive C, type the following command at a command prompt, and then press ENTER:

c:

3. At a command prompt, locate the folder whose contents you want to list. For example, if you want to create a text file that contains a list of the contents in the Windows folder on drive C, type the following commands at a command prompt, and press ENTER after you type each command:

cd\
cd windows

4. Type the following command at a command prompt, and then press ENTER, where filename is the name of the text file that you are creating:

dir > filename.txt

For example, if you want to create a file named Windowsfolderlist.txt, type the following command at a command prompt, and then press ENTER:
dir > windowsfolderlist.txt

NOTE: The text file that you create is located in the folder that you are in when you follow these steps. In the earlier example, the Windowsfolderlist.txt file is located in the Windows folder.

5. Use a text editor, such as Notepad, to view or print this file.

NOTE: You cannot export or print a list of the files that are contained in a folder in Windows Explorer.
Attached Thumbnails
How to Create a File List at a Command Prompt-text_list.jpg  
__________________
"Irony is more humane than its sneering cousin, sarcasm, which is intended to demolish and ridicule." - Richard Handler.
"Respect is earned; it is not a birthright." - Me
"And what is good, Phaedrus, And what is not good - Need we ask anyone to tell us these things?" - Plato
Stoner's Avatar
Account Disabled with 47,328 posts.
 
Join Date: Oct 2002
Location: Dayton,Oh
18-Jan-2004, 06:13 PM #2
Hi Jim,

Two other methods for printing out directories and file contents:



Karen's Directory Printer at
http://www.karenware.com/powertools/ptdirprn.asp

and Prin.bat:

Quote:
The information in this article applies to:
Microsoft Windows 98
Microsoft Windows 98 Second Edition
Microsoft Windows Millennium Edition

This article was previously published under Q272623
SUMMARY
This article explains how to add the print directory feature, and how to enable printing of the directory listing from within Windows Explorer.
MORE INFORMATION
To add the print directory feature to Windows Explorer, follow these steps:
Open Notepad, and then copy and paste the following text into Notepad:
@echo off
dir %1 /-p /o:gn > "%temp%\Listing"
start /w notepad /p "%temp%\Listing"
del "%temp%\Listing"
exit

Save the file as Prin.bat in the Windows directory, and then close Notepad.
Start Windows Explorer, click Tools, and then click Folder Options.
Click the File Types tab, and then click File Folder.
Click Edit, and then click New.
In the Action box, type Print Directory Listing.
In Application used to perform action, click Prin.bat, and then click OK.
Click OK, click Apply, and then click OK.
Open Windows Explorer, right-click the folder that you would like to print a directory listing of, and then click Print Directory Listing.
zephyr's Avatar
Senior Member with 2,385 posts.
 
Join Date: Nov 2003
Location: Southern California, USA
18-Jan-2004, 08:10 PM #3
I'm going to have to second the motion for Karen's Dirprint freebie. Just look at the options:

Attached Thumbnails
How to Create a File List at a Command Prompt-aaa4.gif  
zephyr's Avatar
Senior Member with 2,385 posts.
 
Join Date: Nov 2003
Location: Southern California, USA
18-Jan-2004, 08:17 PM #4
Quote:
NOTE: You cannot export or print a list of the files that are contained in a folder in Windows Explorer.
Jim, I have never had that problem. Can you explain further?
pyritechips's Avatar
pyritechips has a Photo Album
Computer Specs
Community Moderator with 24,368 posts.
 
Join Date: Jun 2002
18-Jan-2004, 08:24 PM #5
No I can't explain. Like I mentioned, that is a Microsoft artile I listed. Those are their words, not mine. Sorry.

But I have a question for you: can The above app print a list from a CD? With the command line I posted, it writes the created file to the directory being listed; obviously it can't write to a CD-ROM.
__________________
"Irony is more humane than its sneering cousin, sarcasm, which is intended to demolish and ridicule." - Richard Handler.
"Respect is earned; it is not a birthright." - Me
"And what is good, Phaedrus, And what is not good - Need we ask anyone to tell us these things?" - Plato
zephyr's Avatar
Senior Member with 2,385 posts.
 
Join Date: Nov 2003
Location: Southern California, USA
18-Jan-2004, 08:34 PM #6
Yes, Karen's software can handle any media you choose to select. It places a right-click item on the context menu and choosing the item named DirPrint (actually anything you choose to name it) will produce the screen I posted above. From there all sources are equal and you have full control over where it goes.

Now I'll have to study on what the heck MS could have meant by that. MS speak always gives me a headache so perhaps I'll just let them slide this time.

Thanks for the comeback Jim.
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
19-Jan-2004, 10:36 AM #7
Jim - cd to any directory you want the list from and

dir > C:\Windows\Desktop\file.txt
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:43 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.