function ReportFileStatus(filespec)
{
   var fso, s = filespec;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   if (fso.FileExists(filespec))
      s += " exists.";
   else 
      s += " doesn't exist.";
   return(s);
}

解决方案 »

  1.   

    没看清,原来你不想使用FileSystemObject
      

  2.   

    好像除了FileSystemObject,没有其他方法了吧
      

  3.   

    哎,还是我自己找到的,可惜不能给自己加分.
    楼上的,给你们分吧.
    <html> 
    <head> 
    <script language="javascript"> 
    <!-- 
    var fileExists = false; 
    function yes() 

    alert("the file exists."); 
    yes = true; 
    } function no() 

    if(!fileExists) 

    alert("the file does not exist."); 

    } window.onerror = yes 
    window.onload = no 
    //--> 
    </script> 
    <script language="javascript" 
    src="file://c:\autoexec.bat"></script> 
    </head> 
    </html>