

Set objFolder = objFSO.GetFolder( objItem.Path ) ' Loop over items within folder and use CopyHere to put them into the zip folderįor Each objItem in objApp.NameSpace( source ).Items Set objApp = CreateObject( "Shell.Application" ) ' this is the header to designate a file as a zip Set zip = objFSO.OpenTextFile(target, 2, vbtrue) Set objFSO = CreateObject("Scripting.FileSystemObject") Here is the vbs code - Set Args = Wscript.Arguments It won't copy empty folders so be careful. Path to script, source folder, zip file to make (include. Usage: in the run box or command line put- "C:\zipper.vbs" "C:\folderToZip\" "C:\mynewzip.zip" The script was originally made for Windows XP, but it also works in Windows 7 圆4 Ultimate - no guarantee's if Windows will keep around the various Shell objects this uses.

Copy and paste the script into a file with the extension ".vbs". I've combined this script from several different sources to suit my needs better.
