I am trying to create a zip file in VBScript and it does not work. I am sure that I am creating the header file correctly.
It creates the actual file correctly, just does not fasten the folder.
Does anyone have any ideas:
Sub ArchiveFolder (folder) Dim fso, wShell, sApp, zipFile Set fso = CreateObject("Scripting.FileSystemObject") Set wShell = CreateObject("WScript.Shell") Set sApp = CreateObject("Shell.Application") Set zipFile = fso.CreateTextFile(folder & ".zip") ' Write zip file header. zipFile.Write "PK" & Chr(5) & Chr(6) & String(18, 0) zipFile.Close sApp.NameSpace(folder & ".zip").CopyHere folder End Sub
source share