问题
I need a VB script to unzip multiple different zip folders. I have this script - but it does not work.
Sub Unzip()
Set fso = CreateObject("Scripting.FileSystemObject")
For Each f In fso.GetFolder("C:\Dal\").Files
If LCase(fso.GetExtensionName(f)) = "zip" Then
Unzip f.path, "C:\Dal"
End If
Next
End Sub
回答1:
The NameSpace
method doesn't support wildcards. Try something like this:
Set fso = CreateObject("Scripting.FileSystemObject")
For Each f In fso.GetFolder("C:\").Files
If LCase(fso.GetExtensionName(f)) = "zip" And Left(f.Name, 11) = "DailySearch" Then
Unzip f.Path, "C:\DailySearch"
End If
Next
来源:https://stackoverflow.com/questions/63393176/a-vbscript-to-recursively-unzip-the-folders-within-a-zip-folder