Zip a folder up

前端 未结 3 1812
Happy的楠姐
Happy的楠姐 2020-12-15 00:34

I am trying to ZIP up a folder in VBScript and it doesn\'t seem to work. I\'m certain I am creating the header file correctly.

It creates the actual file correctly,

3条回答
  •  攒了一身酷
    2020-12-15 01:27

    Check your argument. folder must be the path to the object you want to put into the zip file. If it's a folder object you have to use folder.Path, because the default method of folder objects is Name, and CopyHere can't find the object with just the name.

    You could add some debugging statements to your function to check that:

    WScript.Echo TypeName(folder)
    If fso.FolderExists(folder) Then
      WScript.Echo folder & " exists."
    Else
      WScript.Echo folder & " doesn't exist."
    End If
    

提交回复
热议问题