AuthorMessage
Meka][Meka
Unstopable
Posts: 700

ok someone shown me a prog they made using the kill feature in vb6, this is old, so ive quickly done nice little function to replace it with
now im not too sure of the function kill but as far as i know it just deletes the file so...
old:
Code:
Call Kill(file)

new:
Code:

Private Sub Kill(ByVal file As String)
     If IO.File.Exists(file) Then System.IO.File.Delete(file)
End Sub

-//Meka][Meka
C0D3Z3R0
Pro
Posts: 166

thanks! i always used the old way but this is prob better
Corayzon
Regular
Posts: 67

Here's the same, but for a complete directory removal ;)
Code:
    ' This sub will remove all files and directories within sPath
    Public Sub DeleteDirectory(ByVal sPath As String)
        If IO.Directory.Exists(sPath) Then
            IO.Directory.Delete(sPath, True)
        End If
    End Sub