Best Source of Web Development Tutorials, Articles, Programming Codes, Free PHP Scripts, PHP Tutorials and Much More
Login
Username:
Password:

Delete File


Author :

Date: 2006-03-31


Description : How to delete file as you select?

Option Explicit Private Sub Command1_Click() Dim FileSystem Dim file Dim fileName Dim result 'On Error GoTo errorhandler: CommonDialog1.CancelError = True CommonDialog1.DialogTitle = "Delete a File" CommonDialog1.ShowOpen fileName = CommonDialog1.fileName result = MsgBox("Are You Sure you want to delete" _ & CommonDialog1.fileName & "?", vbYesNo) If result = vbYes Then Set FileSystem = _ CreateObject("Scripting.filesystemobject") Set file = FileSystem.getfile(fileName) file.Delete True End If 'errorhandler: End Sub Private Sub Form_Load() End Sub