Deleting Files

vwFreak
08-31-2000, 11:03 AM
Please help!
how would one go about deleting ALL files in Temporary Internet Files folder from a VB application?
I'm able to delete files from any directory using the Kill command, except for the WINDOWS directory.
here is my Code could someone please tell me what I'm doing wrong.
Thank You
Private Sub cmdDelete_Click()
On Error GoTo FileError
Dim StrPrompt, StrPrompt1 As String
Dim VarReply As Variant
StrPrompt = "WARNING, This Process Cannot be Undone!"
StrPrompt1 = "Process Complete"
VarReply = MsgBox(StrPrompt, vbOKCancel, "DELETE ALL FILES")
If VarReply = vbOK Then
Kill "C:WINDOWSTemporary Internet Files*.*"
MsgBox (StrPrompt1), , "All files have been deleted successfully!"
Else
Unload frmDelete
End If
FileError:
If Err.Number = 53 Then
MsgBox ("The Folder is Empty")
End If
End Sub

Birddog
08-31-2000, 03:47 PM
There is nothing wrong with your code, it's the properties of the folder itself.
That folder is marked as a system folder, click on properties of the folder to see what I mean.
You would have to write an API call to change the properties, delete file(s), then change it back.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum