On Error Resume next Dim fso, f, f1, fc, ss Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder("\\192.168.1.151\myth\h\TV") Set fc = f.SubFolders count=0 For Each f1 in fc count= count + 1 If f1.size <= 0 Then f1.delete End if Next wscript.Echo count,"Empty Folders deleted"