(imported comment written by JasonO91)
I’ve looked at a couple of ways to do this, and it seems like the fastest way to get the job done would be to use some unix utilities that were built for finding files. Then use a vbscript to actually delete the files.
Here’s how I was able to delete all mp3 files from the C:\ drive:
Download the unix utilities for Windows. They’re freely available from: http://unxutils.sourceforge.net/
Once you extract those files, you’ll want to upload the find.exe to the server so that you can download it with the client. (Standard software package deployment stuff)
Now that you have find.exe on the server, you’ll want a vbscript to run it. The task would look something like this:
continue if { (size of it =12345 and sha1 of it = “1234567890abcdefghijklmnop”) of file “big5D.tmp” of folder “__Download”}
extract big5D.tmp
wait __Download\find.exe
delete del_mp3.vbs
appendfile Set objShell = WScript.CreateObject(“WScript.Shell”)
appendfile Set objFSO = CreateObject(“Scripting.FileSystemObject”)
appendfile Set objExecObject = objShell.Exec("%comspec% /c find c:\ -name *.mp3")
appendfile Do While Not objExecObject.StdOut.AtEndOfStream
appendfile strText = objExecObject.StdOut.ReadLine()
appendfile If Instr(strText, “.mp3”) > 0 Then
appendfile objFSO.DeleteFile(strText)
appendfile End If
appendfile Loop
appendfile Wscript.Quit
move __appendfile del_mp3.vbs
wait “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” wscript.exe del_mp3.vbs
----->
This will download the find.exe, then create the vbs file to run and delete files as fast as possible.
If you want to test this script, change the “find c:” to “find c:\tmp” and put some files there.
Hope this helps.
Jason