August 1999
Intermediate to advanced
1488 pages
72h 53m
English
filesystemobject.FileExists(filename)
The FileExists() method is used to determine whether or not a file exists on the current system. This method takes filename as its only parameter, which represents the name of file to check.
Listing 9.79 shows how to use the FileExists() method to check to see if the file test.txt exists.
<html>
<body>
<script language="JScript">
<!-- Hide
function checkfile()
{
var myObject;
// Create an instance of the FileSystemObject
myObject = new ActiveXObject("Scripting.FileSystemObject"); // check to see if the file exists and alert user of status if(myObject.FileExists("c:\\test.txt")){ alert("File Exists"); ... |
Read now
Unlock full access