title: Zip a folder up
body: <p>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.</p>
  
  <p>It creates the actual file correctly, just doesn't zip the folder.</p>
  
  <p>Anyone got any ideas:</p>
  
  <pre><code>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 &amp; ".zip")
  
      ' Write zip file header.
      zipFile.Write "PK" &amp; Chr(5) &amp; Chr(6) &amp; String(18, 0)
      zipFile.Close
  
      sApp.NameSpace(folder &amp; ".zip").CopyHere folder
  
  End Sub
  </code></pre>