e.g, if I want to delete C:\test.txt
Printable View
e.g, if I want to delete C:\test.txt
VB Code:
Kill "c:\test.txt"
in case the file doesn't exist...
VB Code:
On Error Resume Next Kill "c:\peanutbutter.txt"
And to avoid trapping/ignoring errors:
VB Code:
Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileW" ( _ ByVal lpFileName As Long _ ) As Long ' Usage: DeleteFile StrPtr("C:\test.txt")
Quote:
Originally Posted by Pouncer
Here:
IO.File.Delete("C:\test.txt")
:)
1) Only if you are using VB.NETQuote:
Originally Posted by FYRe
2) Only if you have imported the System namespace
;)
That seems to be for .Net :)Quote:
Originally Posted by FYRe
:D Oops..... sorry.
I've been browsing too many webpages in this forum, to have noticed that I actually posted here.. =)
FYRe