August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.Delete()
The Delete() method is used to delete a specified file.
Listing 9.55 shows how to delete a file.
<html>
<body>
<script language="JScript">
<!-- Hide
// function creates a new file and then delete it using the
// delete method
function remove()
{
var myObject;
// Create an instance of the FileSystemObject
myObject = new ActiveXObject("Scripting.FileSystemObject");
var f = myObject.GetFile("c:\\mytest.txt");
f.Delete();
}
//-->
</script>
Delete file "mytest.txt".
<form name="myForm">
<input type="Button" vvalue="Delete File" onClick='remove()'>
</form>
</body>
</html>
|
Read now
Unlock full access