svenne
09-13-2002, 05:39 PM
Hi,
I have been working on a web-project that requiere some parts beeing opened from a CD. The script is designed to scan through the disc-drives on the users computer searching for the file defined at the website, where the script is called from.
Here is my problem: - The script is working just perfectly on my computer, but don't work on any other persons computer. This is a f*cking mystery to me. I have tried setting the Internet Security stuff to LOW, cause I thought it might have something to do with that...but no success. GAAH...this is driving me crazy....I need help!!
Below is the code....
<a href="#" onclick="openFile('/TestFolder/TestFile.zip','',this); return false;"> Open
the file </a>
// JavaScript Document
<!--
function openFile(s_f,cmd,_caller){
var fso=null, d=null, e=null, s=null, fileFound=0,
p="DRIVELETTER:\\"+s_f, c_p=p;
try{
fso=new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
while(!e.atEnd()){
d=e.item();
if(d.DriveType==4){
c_p=p.replace(/DRIVELETTER/,d.DriveLetter);
if(d.isReady &&
fso.fileExists(c_p)){
fileFound=1;
s=new ActiveXObject("Wscript.Shell");
s.Run(cmd + c_p);
s=null;
break;
}
}
e.moveNext();
}
if(!fileFound)
alert("Alert message, can't find CD. Are u sure u have it in your drive?");
}
catch(E){
alert("Alert message, can't find CD. Are u sure u have it in your drive?")
}
finally{
fso=null; d=null; e=null; s=null;
}
}
//-->
I have been working on a web-project that requiere some parts beeing opened from a CD. The script is designed to scan through the disc-drives on the users computer searching for the file defined at the website, where the script is called from.
Here is my problem: - The script is working just perfectly on my computer, but don't work on any other persons computer. This is a f*cking mystery to me. I have tried setting the Internet Security stuff to LOW, cause I thought it might have something to do with that...but no success. GAAH...this is driving me crazy....I need help!!
Below is the code....
<a href="#" onclick="openFile('/TestFolder/TestFile.zip','',this); return false;"> Open
the file </a>
// JavaScript Document
<!--
function openFile(s_f,cmd,_caller){
var fso=null, d=null, e=null, s=null, fileFound=0,
p="DRIVELETTER:\\"+s_f, c_p=p;
try{
fso=new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
while(!e.atEnd()){
d=e.item();
if(d.DriveType==4){
c_p=p.replace(/DRIVELETTER/,d.DriveLetter);
if(d.isReady &&
fso.fileExists(c_p)){
fileFound=1;
s=new ActiveXObject("Wscript.Shell");
s.Run(cmd + c_p);
s=null;
break;
}
}
e.moveNext();
}
if(!fileFound)
alert("Alert message, can't find CD. Are u sure u have it in your drive?");
}
catch(E){
alert("Alert message, can't find CD. Are u sure u have it in your drive?")
}
finally{
fso=null; d=null; e=null; s=null;
}
}
//-->