Alright, here's what I have so far:
I'm trying to find any and all folders on the drive that are named %Kazaa%, %imesh, %blubster% or %emule and delete the folders and all the contents. This script deletes all the files in the root of the folder if it finds the folder, but leaves the folder structure. Is there any way to delete the whole folder structure?
Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Directory WHERE FileName LIKE '%kazaa%'OR FileName LIKE '%imesh' OR FileName LIKE '%blubster%' OR FileName LIKE '%emule'")
For Each objItem in colItems
'WScript.Echo(objItem.Name)
objitem.DeleteFolder
Next
I'm trying to find any and all folders on the drive that are named %Kazaa%, %imesh, %blubster% or %emule and delete the folders and all the contents. This script deletes all the files in the root of the folder if it finds the folder, but leaves the folder structure. Is there any way to delete the whole folder structure?