Skip to content

Instantly share code, notes, and snippets.

@stefanwalther
Created November 6, 2012 21:51
Show Gist options
  • Save stefanwalther/4027833 to your computer and use it in GitHub Desktop.
Save stefanwalther/4027833 to your computer and use it in GitHub Desktop.
VBScript: Delete all files by a given fileMask
'// *****************************************************************
'// Delete all files by a given fileMask
'// ~~
'// Example:
'// DeleteFiles("C:\temp\*.txt")
'// or
'// DeleteFile("*.log") => will delete all .log files in the
'// current folder
'// *****************************************************************
Sub DeleteFiles(ByVal fileMask)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Call objFSO.DeleteFile(fileMask)
Set objFSO = nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment