You can calculate it in VBScript or JavaScript based on the criteria you want, say, collect item by item in a loop, or something like that.Įcho Set objArgs = WScript.Arguments > _zipIt.vbsĮcho InputFolder = objArgs(0) > _zipIt.vbsĮcho Set fso = WScript.CreateObject("Scripting.FileSystemObject") > _zipIt.vbsĮcho Set objZipFile = fso.CreateTextFile(ZipFile, True) > _zipIt.vbsĮcho objZipFile.Write "PK" ^& Chr(5) ^& Chr(6) ^& String(18, vbNullChar) > _zipIt.vbsĮcho Set objShell = WScript.CreateObject("Shell.Application") > _zipIt.vbsĮcho Set source = objShell.NameSpace(InputFolder).Items > _zipIt.vbsĮcho Set objZip = objShell.NameSpace(fso.GetAbsolutePathName(ZipFile)) > _zipIt.vbsĮcho if not (objZip is nothing) then > _zipIt.vbsĮcho objZip.CopyHere(source) > _zipIt. The Compress-Archive cmdlet creates a compressed, or zipped, archive file from one or more specified files or directories. If you want to zip folders in another location, you will have to select the Compress to option, specify the location and the compression mode (as ZIP).
When hovering your mouse cursor over the Compress option and select the Here (as ZIP) option in the menu. People opening the file will need to use software that can open a. Now that folders are selected, right-click wherever you want and select the Compress option. The option that can compress to the smallest file type is 7-Zips own proprietary file type called. When you compress a file with 7-Zip, youll have several format options for saving the file. Zip.CopyHere works with Variant d.Items representing items to be packed. Select 7z from the 'Archive Format' menu. To compress files (or make them smaller) simply drag them into this folder. Your new compressed folder will have a zipper on its icon to indicate that any files contained in it are compressed.
Type a name for the compressed folder and press enter.
#Compress zip folder zip file
What's the problem? Not to create an intermediate directory? I think, it's possible you can use the directory where the zip file is supposed to be created. Open that folder, then select File, New, Compressed (zipped) folder. However, even batch language, despite the brain-damaging features and lack of debugging, is better then many think did you know that it even got method calls? One just need to get familiar with that stuff. I do not claim ownership of this design or the photos.
#Compress zip folder how to
I'll tell you, I never saw anything better, in terms of the beauty and convenience of scripting language (of course, no need to compare with compiling languages), debugger, and the method of binding the APIs. This tutorial will show how to package an InDesign file, as well as, how to compress and zip a folder. If so, will you accept the answer formally (green button)?Īs to PowerShell, it needs some attention and time to get into it.