For whatever reason, there are times when it would be convenient to
know how to delete a file without having to go to the server to
do it. This is just one of the things you can do with the File
Scripting Object.
<%
Dim myFSO 'this line creates an instance of the File Scripting Object named myFSO
SET myFSO = Server.CreateObject("Scripting.FileSystemObject") 'error handling here to make sure that things go smoothly 'if the file does not exist
If myFSO.FileExists("C:\Inetpub\wwwroot\myNewFolder\myNewText.txt") Then 'then we delete it
myFSO.DeleteFile("C:\Inetpub\wwwroot\myNewFolder\myNewText.txt")
Else 'otherwise we tell the client it does so they don't get a nasty error
Response.Write "THIS FILE DOESN'T EXISTS"
End If 'this line destroys the instance of the File Scripting Object named myFSO
SET myFSO = NOTHING
%>