The magazine of the Melbourne PC User Group

Indexing Your CD-ROM Disc Collection
Ken Seamon
seamon@melbpc.org.au

This is a simple system that enables you to index the files in your CD-ROM Disc Collection with DOS. You will be able to quickly find where you stored particular files and you may even find some you didn't know you had.

You will be able to type index 001 to index the first CD-ROM disc in your collection, as shown in Figure 1. For the next disc, you will type index 002. Then, for example, you can type seek myfile.doc to find myfile.doc on any disc you've indexed, as shown in Figure 2. You will type these commands in a DOS window, which you will learn how to create as you read this article.

I should say at this point that you don't need to know anything about DOS (the Disk Operating System from Microsoft) to use this method, because you can download the required files from my Web site at http://www.kenseamedia.com. Click on "Free Downloads" on the side-menu of the homepage. Download indexer.zip. Unzip indexer.zip and save the files into a directory of their own. Further installation instructions are given later in this article.

If you don't have Internet access, the content of each batch file I've written is presented in this article, so that you can create them yourself with your Windows text editor, Notepad.exe. (Just click the "Start" button; select "run" and type "notepad".) A batch file is a file with an extension of .BAT with which can execute DOS commands to perform a wide variety of operations on your computer.


Figure 1. CD-ROM disc indexing command at the DOS prompt.


Figure 2. Search results are presented with Edit.com.

Currently I have 229 CD-ROM discs from magazine covers and other sources. When I first exceeded one hundred I considered junking most of them because I didn't know what was on them, without checking the contents of each one with Windows Explorer. Then I thought that there might be some very useful things hidden away on these discs. See Figure 3.


Figure 3. Dino guards indexed and yellow-labeled CD-ROM disc collection.

I went to http://www.download.com and searched for "CD Catalog". Quite a few programs came up that seemed to fit my need, but many had some negative aspect in the user reviews. Even though others looked quite reasonable in price and function, it occurred to me that I could probably do this in DOS without too much trouble. In fact, there probably are DOS applications that can do this easily, but at this point I wanted to see what I could accomplish with simple DOS batch files.

Remember DOS? DOS is the pre-Windows Microsoft Disk Operating System that still lingers under most versions of Windows. You may have read that it is gone, or hard to access under Windows Me, but that is a myth. Often I hear that DOS is dead. However, because I know a little bit about it, I find that DOS can still be very useful. It is particularly good for file operations that are a bit difficult to accomplish in Windows without using a Windows programming language.

The method described here is for PCs with Win95/98/NT4/2000/Me. Win3.x users can probably run it too, but I've forgotten the steps for setting up the shortcut to DOS on Win3.x. If you are still using Win3.x you may know how to do it anyway. 

Operation 

Here's a description of the four files you will use. The text editor comes with Windows and the others are all created with the text editor.

1. Info.bat - presents a reminder of how to index CD-ROM discs, and how to seek information on the indexed discs. It performs no task except to prompt you with information.

2. Index.bat - sends a directory listing of all the files on the CD-ROM disc into a text file with a unique number for a name, eg. 323.txt. That would be the 323rd disc that you indexed. For the next disc you put in the drive, you would type "index 324". It usually takes only two or three seconds to index a disc, then you will stick a number label on the spine of the disc case for easy reference. When there are two discs in one case, put a label, say 100 on the spine, but "index 100A" and "index 100B" separately.

There is one configurable item in this file. You will have to make one manual edit to this file with Notepad. The 12th line in the batch file is

dir /b /s f:\*.* > %1.txt 

where "f:" is my CD-ROM drive. If your CD-ROM drive letter is not "f:", you must change it to the correct drive letter. For example, if your CD-ROM drive letter is "g:", then the line should read 

dir /b /s g:\*.* > %1.txt

3. Seek.bat - enables you to search for a one-to-three word string (a set of words) through all of your numbered text files, and opens the results of your search with EDIT.COM.

For example, "seek my grocery list" 
(a three word string) would find the following files if they were on an indexed disc: 
my grocery list.txt
my grocery list.doc
my grocery listing.doc

however, it would not find: 
my list.txt
my list.doc
my_grocery_list.doc
grocery list.doc 

So, a two-to-three word string search is fairly exact. Otherwise, use a single word search to find your information. By the way, "seek excel.exe" is a single word search. Individual words are separated by a space. If you know both the filename and the extension, things are very easy.

Wildcard searching, eg. seek *list, is not supported, but I've been using this system for about two years and rarely fail to find what I'm looking for.

4. Edit.com - a simple but powerful text file editor that comes with Windows. It is located in your "c:\windows\command" directory. Edit.com has a search feature that you can use to refine your search within the results. 

Installation 

The Figures presented here may be somewhat different on your PC, depending on your version of Windows.

1. Place all of the batch files (extension ".bat") in the same directory. In my case, I made a directory, D:\CD_INDEX

2. Create a DOS shortcut on your Desktop, using the following steps:

  • right-click on an empty part of your Windows Desktop

  • select "New"

  • select "Shortcut" (Figure 4).

  • in the "Command line:" field type: C:\WINDOWS\COMMAND.COM and click "Next" (Figure 5).

  • in the "Select a name for the shortcut" field type: CD INDEXER and click "Finish" (Figure 6).


Figure 4. Creating a shortcut on the desktop.


Figure 5. Entering the Command line.



Figure 6. Naming the shortcut.


3. You will now have a new icon on your Desktop. Right-click on this icon and select "Properties", then select the "Program" tab. The fields you need to enter, and the information you need to type, are:
  • "Working:" D:\CD_INDEX (or whatever drive/directory name you chose to use)
  • "Batch file:" info.bat (Figure 7).
4 . You may click the "Change Icon" button if you wish to select a different icon, or just click OK to save your changes.

Now you are ready to click the "CD Indexer" icon on your Windows Desktop and start indexing your CD-ROM disc collection. When you click on the shortcut, command.com runs and opens a DOS box on your Windows desktop, then it runs the batch file info.bat. From there you run the other batch files. Enjoy!

 


Figure 7. Setting the program properties for the shortcut.

Bat file listings:

About the Author:
Ken Seamon, seamon@melbpc.org.au has spent the last 15 years designing and developing computer-based training for large systems installations in various countries, and using automated testing tools to test large systems. He is also a graphics artist who co-authors, with his wife, Joan James, illustrated eBooks for children.


Reprinted from the March 2001 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[About Melbourne PC User Group]