Dim Fso, Drives, Drive, Folder, Files, File, Subfolders,Subfolder
Set Fso=createobject("scripting.filesystemobject")
Set Drives=fso.drives
For Each Drive in Drives
If drive.isready then
Dosearch (drive & "\")
end If
Next
Function Dosearch(Path)
wscript.echo "Processing folder " & path
Set Folder=fso.getfolder(path)
Set Files = folder.files
For Each File in files
if file.size = 0 then
wscript.echo path & file.name & " found size is 0. Deleted."
fso.DeleteFile (path & file.name)
end if
Next
Set Subfolders = folder.SubFolders
For Each Subfolder in Subfolders
Dosearch (Subfolder.path & "\")
Next
end function
Set Fso=createobject("scripting.filesystemobject")
Set Drives=fso.drives
For Each Drive in Drives
If drive.isready then
Dosearch (drive & "\")
end If
Next
Function Dosearch(Path)
wscript.echo "Processing folder " & path
Set Folder=fso.getfolder(path)
Set Files = folder.files
For Each File in files
if file.size = 0 then
wscript.echo path & file.name & " found size is 0. Deleted."
fso.DeleteFile (path & file.name)
end if
Next
Set Subfolders = folder.SubFolders
For Each Subfolder in Subfolders
Dosearch (Subfolder.path & "\")
Next
end function