Google
 
Web www.theeldergeek.com

Home     |     Forum     |     Commentary     |     About TEG     |     Links     |     Advertise     |     Contact TEG

Subscribe to The Elder Geek Content Update Notification          |||          The Elder Geek on Windows XP Forum Is Open for Posting !

Index   >>>   A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z   <<<   Index

Windows XP
*SP2 = Item Updated w/SP2 Info

Install / Remove

Bare Bones Troubleshooting
Driver Scan by Touchstone Software
Dual and MultiBooting XP
Install Backup for XP Home
Remove Microsoft Messenger
Slipstreamed XP/SP2 Bootable CD *SP2
Slipstreamed XP/SP1a Install
Slipstreamed XP Update Rollup
Slipstreamed XP/SP3 Bootable CD
Uninstall via C:\ Prompt
Use F5 to Specify ACPI BIOS
Windows XP Upgrade Paths
XP Home Clean Install - Graphic
XP Pro Clean Install - Graphic
XP Pro Clean Install - Text Version
XP Pro Upgrade Install -Text Version

OS Guides from WindowsReinstall.com

Boot Disk Resources

Bootdisk.com Main Page
Bootdisk.com Downloads

Security and Updates

Automatic Update  *SP2
HotFix & Security Bulletin Svc
Hot-Fix Verifier
Issues After You Install Updates to Internet Explorer or Windows
Microsoft Update - Overview
Microsoft Update - Installing
Microsoft Update - Usage

Search MS for Updates
Security Information
Service Pack 1
Service Pack 2 Beta Release
Windows AntiSpyware (Beta)
Windows Firewall   *SP2
Windows Security Center  *SP2
Windows Update Catalog
Windows Update Troubleshooter

Registry

Backing Up and Restoring
Recover Corrupted Registry
Registry Edits

DDR Memory at Crucial.com

User Interface

Classic Start Menu and Desktop
Create Shortcut Wizard
Custom Win Explorer Views
Feature Guides
File Management Tips
Windows Classic Interface
Windows XP Power Toys
Windows XP User Interface

Network and Internet

Guide to Simple File Sharing
Internet Connection Firewall
Repair IE6 and OE6
Running IIS on XP Home

System

Back Up Using Advanced Mode
Back Up Using Backup Wizard
Baseline Security Analyzer v1.2
Compatibility Mode
Control Panel
Define A Backup Strategy
Disk Cleanup Utility
Disk Defragmenter Utility
Disk Management Utility
Group Policy Editor
Hard Drive Partitioning
Install/Use Recovery Console
Management Console
Paging File
Stop Error Messages
System Restore
Re-enable System Restore
System Services Guide
System Volume Info Folder
XP Shutdown Troubleshooting

Hardware

Move Current XP Hard Drive
Replace XP System Motherboard

Miscellaneous

Bill Gates Newsletter
Bits to Exabytes
Longhorn 4015 Preview
Windows Timeline

Windows XP FAQ

Outlook Express 6

Repair IE6 and OE6
Repair Spell Check in OE6
Welcome Screen Mail Notification

Internet Explorer 6

List of Fixes in IE6 SP1
Maximize IE6 On Opening
Repair Internet Explorer 6
Repair or Reinstall IE6 and OE6

Virus/Spyware/Malware

Blaster and Sobig Worms
The Download.Ject Mess
Return Receipt Outlook Scam

Downloads

Driver Scan by Touchstone Software
Baseline Security Analyzer v1.2
XP Media Player 9
Release Notes for WMP9
XP Professional Downloads
Recent MS Service Pack Listings

MS Windows AntiSpyware (Beta)

Memory from Crucial.com

Knowledge Base Articles

Accessibility Options
Add or Remove Programs
Appearance and Themes
Date Time Language Regional
Network and Internet Connections
Performance & Maintenance
Printers and Other Hardware
Setup
Sounds Speech Audio Devices
User Accounts

Microsoft Resources

Windows XP Professional
Windows XP Home Edition
Windows XP Update
Windows XP Expert Zone
Microsoft Security
Desktop Deployment Res. Ctr.
Microsoft TechNet
MSDN
Product Support Services
Microsoft Download Center
Guide to Downloads
Windows XP Support Center
Windows XP Technical Overview
DLL Help Database
Windows Life-Cycle Policy
MS Product Feedback
XP Pro Windows Folder Contents

IIS 6.0 Resource Guide
Microsoft Skills Assessment
 

Has The Elder Geek
site been useful?

Consider A Donation
 

Privacy Policy

 

TEG is hosted by:
Hosting Matters

Crucial Memory Selector


Untitled Document Recommended: Click here to run a FREE system scan


 
Generate a File Listing from a Windows Explorer Context Menu

How many times have you been browsing through directories in Windows Explorer and wished you could generate a text file or printout listing the files and folders? It seems like such a simple request that it's amazing the option isn't available. You don't believe me? Right click on a folder and see for yourself if there is an option to list or print the structure. There isn't, but there is a workaround that doesn't require any third party software. Here's how to create a context menu item that when clicked will generate an editable text file listing of the selected directory.

Step 1 - Create A Batch File

To create the entry in the context menu it's necessary to first create a .bat file. The format for the .bat file is:

dir /a /-p /o:gen >filelisting.txt

The name of the .txt file can be whatever you'd like it called. In the example above it's filelisting, but it could just as easily be filelist, listoffiles, namedfiles, or even wally if you have a sense of the bizarre. Once you've decided on the name, create the file in Notepad and save the file in your Windows folder as shown below. If you want, just copy and paste the example up above if you don't find wally intriguing.


Fig. 01

Step 2 - Modify The Context Menu

Now that we have the .bat file created the next step is to make it functional and easily accessible by integrating it into the context menu that opens when a right click is executed. To do this:

Open Windows Explorer, click Tools, then click Folder Options.
Click the File Types tab, and then click Folder.
Click the Advanced button and then click New to pen the New Action box shown below.


Fig. 02

In the New Action [Fig. 02] box, type the name that you want to appear in the context menu. Once again, you have a wide latitude in choices but something akin to Create File Listing will probably be more useful than naming it Martha Stewart. As you can see in the example above, I ditched Martha in favor of Create File Listing. Sorry Martha. Browse to the location where the .bat file you created is located, select it and let it be the Application Used to Perform Actions. Click OK and do the standard Windows dance of Apply and OK again to close all the open windows.

That's it !  Congratulations. You've created a new item on the context menu that's ready to go to work. So now that's it there, what can you do with it? Open up Windows Explorer as I did in the example [Fig. 03] below.


Fig. 03

Navigate to whatever folder you want to use as the basis for the file list and right click to open the context menu. Click on the Create File Listing item and the list will be generated and displayed at the bottom of the open window as filelisting.txt. The example below was created from the Sample Music folder shown above. Since it is a text file it can be fully edited, copied, pasted, printed, etc for any purpose.


Fig. 04

Note: If for any reason you want to remove the Create File Listing entry from the context menu it will be necessary to edit the registry. This can be accomplished by navigating to HKEY_CLASSES_ROOT\Folder\shell\Create_File_Listing using regedit and deleting the Create_File_Listing key in the left pane. Close regedit and reboot to complete removal.


Additional File Modifications Submitted by TEG Readers


The following tip was sent in containing a very useful modification to the batch file;

Adding the "/b" switch to the proposed batch file will create a "bare format (no heading information or summary)" text which makes the output much easier to copy and manipulate. It eliminates all the other garbage in the output file.
 
Best regards,

Geert Pauwels

This is an excellent idea and very easy to implement. If you are creating the batch file for the first time just modify the file listed in the article so it reads;

dir /a /b /-p /o:gen >filelisting.txt

and continue with the instructions for completing the modification. If the batch file already exists in C:\Windows, navigate to the file, right click it and select Edit from the context menu and modify the file so it contains the /b switch. Save the changes and close the file. The change will modify the output so it appears as shown below.


Fig. 05

While it's easy enough to go into the C:\Windows directory and edit the batch file to generate the type of output preferred, depending on how often you change between the two output formats you may find it more convenient to create separate entries for each format that can be selected from the context menu. The procedure is simple.

  • Create one batch file using the /b switch and name it filelisting.bat.

  • Create a second batch file without the /b switch and name it filelisting1.bat.

  • Save both files in C:\Windows.

  • Modify the context menu as shown in Step 2 and Fig. 02 above, but this time go through the procedure twice and give each entry a different name in the Action line, assigning each entry a different batch file. I used the names "Create File Listing" and "Create File Listing Verbose" for this example, assigning the batch file with the /b switch to "Create File Listing" and the batch file without the /b switch to the "Create File Listing Verbose" entry.

  • Both entries are now on the context menu and available for use as shown in Fig. 06.


Fig. 06

 


The following modification was submitted by Antony

Hi,

Thanks for the tip on generating a directory listing from windows explorer - this has bugged me for ages. 

Just wanted to add that when I run the command as listed, the file gets created in the directory that I want a listing for, but is never displayed automatically (I have to open it manually). This was annoying so I fixed it by doing the following:

  1. Specifying that the directory listing file always gets saved in the same location.

  2. Using the Start command to open the file with Notepad.

 Here is the modified batch file.

dir /a /b /-p /o:gen >C:\Temp\List_Files.txt
start notepad C:\Temp\List_Files.txt


The following modification was submitted by Max

Hello, I enjoyed learning how to create file listing with the method provided on http://www.theeldergeek.com/file_list_generator.htm
 
I have however created a modification that people should enjoy.
 
By adding the line cd %1 to the top of the bat file, you can right click on a folder select Create a File List, and then the txt file will be saved inside that folder with a listing of the contents of that folder.
 
The next modification prevents the generated textfile from being listed within its self. The two lines are added under the dir command.

copy "C:\Temporary Location\textfile.txt" %1

del "C:\Temporary Location\textfile.txt"
 
Thus, my entire bat file looks like this:
cd %1
dir /a /b /-p /o:GEN >"C:\Documents and Settings\<your username>\Local Settings\Temp\filelist.txt"
copy "C:\Documents and Settings\<your username>\Local Settings\Temp\filelist.txt" %1
del "C:\Documents and Settings\<your username>\Local Settings\Temp\filelist.txt"
 
Please remember to use the quotations...otherwise, dos won't be able to deal with the spaces.
 
Enjoy,

Max


The following modification was submitted by Kevin

I've been trying to figure out how to capture a listing of files from within a folder -- but I don't want to print the list, just save it to a disc.  (I'm sending a buddy a listing of all of the CD's that I've burned.)

I found your article entitled, "
Generate a File Listing from a Windows Explorer Context Menu" -- and although none of the solutions worked perfectly for me, I did some minor editing to give me what I needed.

I needed a batch file which would create a listing, allow me to cut, copy or print the contents, then delete the file itself (I have no need for a permanent file listing cluttering up my hard drive).

Here it is:

dir /a /-p /o:gen >filelisting.txt
filelisting.txt
del filelisting.txt

Thanks again for a wonderful site.


Kevin


 

The Elder Geek on Windows XP Website CD ROM
Pricing Information
 

 

Slipstreamed XP/SP2 CD
How to create including
burning instructions for
Nero and Roxio

Slipstreamed XP/SP3 CD

Service Pack 2
Articles Archive

Guide to Simple File Sharing
Share Folders, Files, and Printers in XP Home and Professional

Virtual Memory Paging File
Size - Optimize
Defragment - Monitor

Common Solutions

Has The Elder Geek site been useful?

Consider A Donation
 

 

Crucial.com

Crucial Memory Selector

 

Basic How To Articles
for XP Newbies

 - Managing Starting / Stopping XP
 - Managing Basic Desktop Components
 - Managing Basic Hardware Settings
 - Managing Folders and Files
 - Managing Applications

System Services Guide

Troubleshooting Shutdown Issues

XP File Management
Tips to organize Quick Launch, Search, and Windows Explorer for easier, efficient use.

Protecting System and Data Via NTBackup
Backup w/ Wizard
Backup w/ Adv. Mode

 

 

Windows Update Catalog
Windows Update Catalog offers centralized XP and .NET Critical Updates, Service Pack, and Hardware Driver Downloads

Automatic Update

Advertise with TEG
Rate Card

XP Power Toys
Power Toys Download

Clean or Upgrade
XP Installation?

Which is better?

Has The Elder Geek site been useful?

Consider A Donation
 
 

Bare Bones Troubleshooting
Tried everything and can't get XP to install? Take a look here.

The 'System Volume Information' Folder
What is it and why is it taking up room on your hard drive(s)?

Microsoft Management Console
A Guide to Understanding and Using This Often Overlooked but Useful XP Feature

Registry Tweaks and Edits

Backing Up and Restoring the XP Registry

 
 

Accessing The Different Methods of Repair Available in Windows XP

Generate File Listings from IE Context Menu

The "Send To" Menu Command
Add your own frequently accessed locations to make this context menu more useful.

Has The Elder Geek site been useful?

Consider A Donation
 

 

Create A Personalized Boot Logo Screen

Using XP Disk Cleanup Utility

Using Disk Defragmenter Utility

Common Solutions

Tips and Solutions Arranged by XP Control Panel Groupings

 

 

Google
  Web www.theeldergeek.com   

-  Important Information  -
The Elder Geek on Windows XP site contains many articles and suggestions for modifying the Windows XP operating system. I've tried these tweaks and tips on many systems. Sometimes they work, sometimes not. The point is, ensure you have a current, tested backup of all system and data files and understand how to restore the system in case something goes very wrong. You can still yell at me, but I assume no responsibility for your actions and use of the information and disclaim any legal responsibility for any consequences of such actions.

Copyright © 2002/2003/2004/2005/2006/2007/2008, Jim Foley/The Elder Geek, All Rights Reserved Worldwide
Reproduction, in any form, of information on this site is prohibited without express written permission.
Microsoft is in no way affiliated with, nor offers endorsement of, this site.