samples

Another Windows batch file I wrote up that will delete all folders and files with (SAMPLE) in the file or folder name.

Please note you can download the full .bat file below.

'On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
ShowSubFolders objFSO.GetFolder("E:")
Sub ShowSubFolders(Folder)
For Each file In Folder.Files
Set objCurFile = objFSO.GetFile(file)
If Instr(ucase(objCurFile.Name), UCase("sample")) Then objCurFile.Delete
On Error Resume Next
For Each Subfolder in Folder.SubFolders
ShowSubFolders Subfolder
Next
End Sub