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,
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