Posted on 2003-10-27
I have the following issue. I want to produce a CD with (among others) a HTML file with the capability of reading files on that CD and linking to those files in the HTML file. Now my problem is that the files on the CD's never have the same filename.
Basically what i'm trying to do is the following:
1) CD autoruns the HTML file (no problems with this!)
2) HTML file has a script that looks at the different files on the CD and returns them as clickable links in the HTML
The code I have so far is:
alert("Please click yes to the following system message in order for this link to work properly")
var drive_letter, fso, f, fc, s, sFile, text, text2;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(drive_letter+":\\");
fc = new Enumerator(f.files);
s = "";
var counter = 0
for (; !fc.atEnd(); fc.moveNext())
s += fc.item();
s += "<BR>"
//text2 = (s.slice(3,100))
// alert("You got " + counter + " files in that folder!");
Obviously this is only working partially. I'm now able to display all files in the core directory of the CD, but I can't seem to figure out how to pick up one filename and turn that into a link. With "Return(s)" I get all filenames. How can I turn those filenames to a string so I can use them in a link? All your help is much appreciated!!