<script>
var fso=new ActiveXObject("scripting.filesystemobject")
if(fso.fileExists("F:\\js.rar"))
alert('文件存在')
else
alert('文件不存在')
</script>
var fso=new ActiveXObject("scripting.filesystemobject")
if(fso.fileExists("F:\\js.rar"))
alert('文件存在')
else
alert('文件不存在')
</script>
function xxx()
{
var objFSO = new ActiveXObject("Scripting.FileSystemObject");
var url = document.all("t1").value;
if(objFSO.FileExists(url) == 0)
alert("文件不存在");
else
alert("文件存在");
}
</script>
<input type="text" id="t1"><input type="button" value="检测" onclick="xxx()">