My brother dcrew fixed it, thanks for trying to help though.

Code:
    Public Function getIcon(ByVal path As String) As Icon
        If (File.Exists(path)) Then Return System.Drawing.Icon.ExtractAssociatedIcon(path)
        Return Nothing
    End Function
edit: it was also another piece of code that needed fixing, he fixed though.