All Forums >> [Scripting] >> Post a VBScript >> Script for indexing & searching data CDs Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Ok, here's a script that will index the file & path names of files on a CD, give the disc a unique number, and keep a text file of the contents of the disc, then allow searching of these text files.
If you run it with a disc in that's not been indexed before, it'll write the contents to a text file and then tell you which number to label the disc with.
If you run it with a disc in that's been indexed before, it'll open the text file of that disc
If you run it with no disc in, it'll let you search for a term across all the indexes, and return the disc numbers of discs which have file names matching your search.
You need to set objPath to the letter of your CD drive.
You need to change objCDFolder to whatever folder you want the text files to be saved in. Within this folder you need a sub folder called Index, and within sub folder Index you need a text file called index.txt. This text file *must* have 1 line to start with, and that line must start with a zero and then a comma, then anything you like. For example mine's reads:
0,Index
Also there *must* be a carriage return after the 1st line. In other words with the text file open in notepad, and the cursor at the end of the word "Index", you should be able to use the down arrow on your keyboard to bring the cursor down to line 2, no less, no more.
Here's the code, suggestions, comments and criticism greatly appreciated: