Created
November 6, 2012 21:51
-
-
Save stefanwalther/4027833 to your computer and use it in GitHub Desktop.
VBScript: Delete all files by a given fileMask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'// ***************************************************************** | |
'// 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