Thanks. But what kind of settings I should change on IE4 to enable 'fso =
new ActiveXObject("Scripting.FileSystemObject");'?
I think I made the same settings on IE 5 and IE 4. Why does the code only
work on IE 5?
Quote:
> The security zone configuration is the same for IE3x and IE4x as it is for
IE5x.
> Q182569 - Description of Internet Explorer Security Zones Registry Entries
> http://support.microsoft.com/support/kb/articles/q182/5/69.asp
> Using unsafe components in client side code is OK for personal (and
perhaps Intranet) use, but
Quote:
> certainly not for general Internet use.
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
> Please do not email questions - post them to the newsgroup...
> --
Quote:
> > Is there any way in Jscript or Javascript to get the drive letter of
> > client's CD-ROM?
> > I wrote a drive.htm file. it works fine in IE5, but not in IE 4.0.
> > In IE 4.0, I got an error saying "automation servers can't create
object" on
> > "fso = new ActiveXObject"("Scripting.FileSystemObject");
> > Anyone knows why? I tried to lower the security level on IE 4.0.
> > Thank you.
> > Here is the code
> > <HTML>
> > <HEAD>
> > <SCRIPT LANGUAGE="JScript">
> > function ShowDriveList()
> > {
> > var fso, s, n, e, x;
> > fso = new ActiveXObject("Scripting.FileSystemObject");
> > e = new Enumerator(fso.Drives);
> > s = "";
> > for (; !e.atEnd(); e.moveNext())
> > {
> > x = e.item();
> > s = s + x.DriveLetter;
> > switch (x.DriveType)
> > {
> > case 0: s += "[Unknown]"; break;
> > case 1: s += "[Removable]"; break;
> > case 2: s += "[Fixed]"; break;
> > case 3: s += "[Network]"; break;
> > case 4: s += "[CD-ROM]"; break;
> > case 5: s += "[RAM Disk]"; break;
> > }
> > s += " - ";
> > if (x.DriveType == 3)
> > n = x.ShareName;
> > else if (x.IsReady)
> > n = x.VolumeName;
> > else
> > n = "[Drive not ready]";
> > s += n + "<br>";
> > }
> > document.write(s);
> > }
> > </SCRIPT>
> > </HEAD>
> > <BODY>
> > Your drive info: <BR>
> > <SCRIPT>
> > ShowDriveList();
> > </SCRIPT>
> > </BODY>
> > </HTML>