..


Sponsored Links

DeleteFile

The FileSystemObject object's DeleteFile method deletes the file or files specified. Note that if the file had to be deleted does not exist will return an error. The DeleteFile method accepts two parameters:

  • filename - name of the file or files to be deleted (wildcards are permitted);
  • Force - optional parameter; Boolean value that indicates whether read-only files will be deleted. True indicates that the read-only files will be deleted, while False indicates that the files are not deleted. The default is False.
Example:





 Dim fs







 'I create an instance of the FileSystemObject







 Set fs = Server.CreateObject ("Scripting.FileSystemObject")









 'Check that the file exists ...







 If fs.FileExists ("c: \ test.txt") Then



  



 'If it exists delete it



  



 fs.DeleteFile ("c: \ test.txt")







 End If









 'I cleaned







 Set fs = Nothing



In the same category ...
E-Learning
ASP (Advanced) ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €.
ASP Zero (Ebook) ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €.
ASP and Access (Ebook) ASP and Access (Ebook)
Managing a MS Access database with ASP. At only 29 €.
Sponsored Links