Detalhes
Sevocêclicarem"exibir a mensagem", verá uma caixa de diálogo muito antiga intitulada: Acesso a pastas negado com o texto Você precisará fornecer permissão de administrador para copiar esta pasta .
Pareceque,dealgumaforma,oUACestárelacionado,excetoqueoUACésupostamentedesativado.
ConstnoProgressYesAll=&H14DimobjFSOSetobjFSO=CreateObject("scripting.filesystemobject")
zipFile = "C:\test.zip"
unzipPath = "C:\test\"
WScript.Echo "ZIPEXTRACTDIR: " & unzipPath
WScript.Echo "ZIPFILE: " & zipFile
If objFSO.FileExists(zipFile) Then
If objFSO.FolderExists(unzipPath) Then
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace(zipFile)
If objSource is Nothing Then
printMsg "Invalid Zip File " & zipFile
Else
unzipLog = zipFile&".log"
printMsg "Logging to " & unzipLog
Set objLog = objFSO.OpenTextFile(unzipLog,fsoForWriting,True)
Set objTarget = objShell.NameSpace(unzipPath)
objTarget.CopyHere objSource.Items, noProgressYesAll
For Each item in objSource.Items
printMsg "Extracted: " & unzipPath&item.Name
objLog.Write unzipPath&item.Name & vbCrLf
If objFSO.FileExists(unzipPath&item.Name) Then
printMsg "Verified File: " & unzipPath&item.Name
Else
If objFSO.FolderExists(unzipPath&item.Name) Then
printMsg "Verified Folder: " & unzipPath&item.Name
End If
End If
Next
objLog.Close
End If
Else
printMsg "Directory does not exist: " & unzipPath
End If
Else
printMsg "Zip file does not exist: " & zipFile
End If
Set objLog = Nothing
Set objSource = Nothing
set objShell = Nothing
set objTarget = Nothing