Redirect to the point where error occured

  • Something like this, maybe:

    Dim f As String

    For Each f In System.IO.Directory.GetFiles(path)

    System.IO.File.Delete(f)

    Next f

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • This is what I had done

    Dim f As String

    For Each f In System.IO.Directory.GetFiles(path)

    If f.EndsWith(".exe") Or f.EndsWith(".EXE") Then

    a = "sssss"

    Else

    System.IO.File.Delete(f)

    End If

    Next f

    Rex Smith

  • RexSmith (5/20/2010)


    This is what I had done

    Dim f As String

    For Each f In System.IO.Directory.GetFiles(path)

    If f.EndsWith(".exe") Or f.EndsWith(".EXE") Then

    a = "sssss"

    Else

    System.IO.File.Delete(f)

    End If

    Next f

    You could tidy up a little, but I doubt it will make any difference other than to aesthetics:

    If f.ToUpper.EndsWith(".EXE") Then

    ....

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply