Freedom Computers

Delete a File.  Show file attributes in VB

Routine to Delete file using VB

Set fs = CreateObject("Scripting.FileSystemObject")
fs.DeleteFile ("c:\Documents and settings\Mr Ticehurst\My Documents\glencrete\dailysales.xls")
----------------------------------------------------------------------

Display file attributes

Set f = fs.GetFile("c:\Documents and settings\Mr Ticehurst\My Documents\glencrete\dailysales.xls") '
s = f.Name & " on Drive " & UCase(f.Drive) & vbCrL 'f
s = s & "Created: " & f.DateCreated & vbCrLf
s = s & "Last Accessed: " & f.DateLastAccessed & vbCrLf
s = s & "Last Modified: " & f.DateLastModified
MsgBox s, 0, "File Access Info"


ACCESS