May 5, 2010 at 12:57 pm
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
May 20, 2010 at 4:34 am
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
May 20, 2010 at 4:57 am
RexSmith (5/20/2010)
This is what I had doneDim 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