Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTopFolder = objFSO.GetFolder("C:\Books")
For Each objSubFolder In objTopFolder.SubFolders
For Each objFile In objSubFolder.Files
WScript.Echo "Delete " & objFile
objFSO.DeleteFile objFile
Next
For Each objSubSubFolder In objSubFolder.SubFolders
WScript.Echo "Delete " & objSubSubFolder
objFSO.DeleteFolder objSubSubFolder
Next
Next
|