Mourning the loss of our friend, WhitPhil.
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 audio black screen blue screen boot bsod connection crash dell desktop drivers dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery router safe mode slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista 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

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
pyritechips's Avatar
pyritechips has a Photo Album
Computer Specs
Community Moderator with 16,982 posts.
 
Join Date: Jun 2002
Location: Cowtown, against my will
Experience: PHD -poop handling degree
18-Jan-2004, 08: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  
__________________
"Respect is not a birthright; it is earned."
"Irony is more humane than its sneering cousin, sarcasm, which is intended to demolish and ridicule..." - Richard Handler
Stoner's Avatar
Distinguished Member with 39,510 posts.
 
Join Date: Oct 2002
Location: Dayton,Oh
18-Jan-2004, 05: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
Distinguished Member with 2,385 posts.
 
Join Date: Nov 2003
Location: Southern California, USA
18-Jan-2004, 07: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
Distinguished Member with 2,385 posts.
 
Join Date: Nov 2003
Location: Southern California, USA
18-Jan-2004, 07: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 16,982 posts.
 
Join Date: Jun 2002
Location: Cowtown, against my will
Experience: PHD -poop handling degree
18-Jan-2004, 07: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.
__________________
"Respect is not a birthright; it is earned."
"Irony is more humane than its sneering cousin, sarcasm, which is intended to demolish and ridicule..." - Richard Handler
zephyr's Avatar
Distinguished Member with 2,385 posts.
 
Join Date: Nov 2003
Location: Southern California, USA
18-Jan-2004, 07: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, 09:36 AM #7
Jim - cd to any directory you want the list from and

dir > C:\Windows\Desktop\file.txt
Closed Thread Bookmark and Share

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.

Smart Search

Find your solution!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 07:09 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.