title: Creating a Zip then copying folders to it
body: <p>I'm trying to create a zip file, then copy three folders into it. I get the error on line 33 char 1, error state object required, I have searched and googled but just can't seem to either understand what I'm reading or understand what I really need to search for. Anyhow, here is my code.</p>
  
  <pre><code>Option Explicit
  Dim objFSO, objFolder1, objFolder2, objFolder3, FolderToZip, ziptoFile, FolderGroup
  Dim ShellApp, eFile, oNewZip, strZipHeader
  Dim ZipName, Folder, i, Zip, Item
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set objFolder1 = objFSO.GetFolder("C:\Windows\Temp\SMSTSLog")
  Set objFolder2 = objFSO.GetFolder ("C:\Windows\System32\CCM\Logs")
  Set objFolder3 = objFSO.GetFolder ("C:\Windows\SysWOW64\CCM\Logs")
  'For Each efile In objFolder.Files
  '  If DateDiff("d",eFile.DateLastModified,Now) &gt;= 2 Then
  '    objFSO.MoveFile eFile, "C:\Documents and Settings\User\Desktop\Test2\"
  '  End If
  'Next
  Wscript.Sleep 2000
  Set oNewZip = objFSO.OpenTextFile("C:\win7tools\testing script.zip", 8, True)
  strZipHeader = "PK" &amp; Chr(5) &amp; Chr(6)
  For i = 0 To 17
    strZipHeader = strZipHeader &amp; Chr(0)
  Next
  oNewZip.Write strZipHeader
  oNewZip.Close
  Set oNewZip = Nothing
  WScript.Sleep 5000
  FolderGroup = Array(objFolder1,objFolder2,objFolder3)
  
  FolderToZip = "FolderGroup"
  ZipToFile = "C:\Win7tools\Test Script.zip"
  Set ShellApp = CreateObject("Shell.Application")
  Set Zip = ShellApp.NameSpace(ZipToFile)
  'Set Folder = ShellApp.NameSpace(FolderToZip)
  ShellApp.NameSpace(FolderGroup).CopyHere Zip.NameSpace(ZipToFile)
  WScript.Sleep 10000
  
  set ShellApp = Nothing
  set FolderToZip = Nothing
  set ZipToFile = Nothing
  </code></pre>