The next two lines of code allow you to delete all files with a particular extension in a folder.
Set obj = CreateObject("Scripting.FileSystemObject")
obj.DeleteFile("C:\Windows\*.log")
The example below will delete all of the .log files from the C:\Windows
folder.