salve,
ho questo problema.
ho uno script in vbs che non fa altro che zippare una cartella. eccololo script funziona, ma se nella cartella esiste una cartella vuota, si interrompe con questo errore:codice:Option Explicit Const FOF_CREATEPROGRESSDLG = &H0& Dim sSourceFolder Dim sArchiveFile Dim oShell Dim oZIP Dim oSourceFolder 'Settaggio Variabili sSourceFolder = "C:\database" sArchiveFile = "C:\database_zip-"&Year(date())&Month(date())&Day(date())&".ZIP" Dim oFSO Dim oFile Dim iFiles Dim Fldr Set oFSO = CreateObject( "Scripting.FileSystemObject" ) Set oFile = oFSO.OpenTextFile( sArchiveFile , 2, True ) oFile.Write "PK" & Chr(5) & Chr(6) & String( 18, Chr(0) ) oFile.Close Set oFile = Nothing Set oFSO = Nothing iFiles = 0 With CreateObject("Shell.Application") 'Copy the files to the compressed folder .NameSpace(sArchiveFile).CopyHere .NameSpace( sSourceFolder ).Items, FOF_CREATEPROGRESSDLG iFiles = iFiles + .NameSpace( sSourceFolder ).Items.Count 'Keep script waiting until Compressing is done On Error Resume Next Do Until .NameSpace( sArchiveFile ).Items.Count = iFiles wScript.Sleep 1000 Loop On Error GoTo 0 End With
File zip mancante o vuoto!
come posso risolvere il problema??

Rispondi quotando