1

I know that in a linux enviroment it is possible to zip a folde into multiple smaller zip archives as such:

zip -r -s 64 archive.zip FolderName/

But is there an equivalent option using powershell or commandprompt?

nano
  • 75
  • 1
  • 12
  • duplicate of https://stackoverflow.com/questions/1153126/how-to-create-a-zip-archive-with-powershell?rq=1 – pandemic Apr 23 '18 at 08:13
  • @pandemic it is *not* a duplicate. Here the OP asks how to do a zip archive split on based on size. – tukan Apr 23 '18 at 08:33

1 Answers1

2

If you want to create a multi-part zip archive you can give DotNetZip a shot.

This is how it works in C#

using (ZipFile zip = new ZipFile())
{
  zip.UseUnicode= true;
  zip.AddDirectory(@"Folder");
  zip.MaxOutputSegmentSize = 100*1024 ; // 100k segments
  zip.Save("MyFiles.zip");
}

Or if you can settle with 7zip, there is 7ZipPowershell that allows you to do just that:

PS> Install-Module -Name 7Zip4Powershell
PS> Compress-7Zip -Path . -VolumeSize 102400 -ArchiveFileName "C:\Users\me\Desktop\abc.7z"

PS: The segment size is in both cases in byte.

wp78de
  • 18,207
  • 7
  • 43
  • 71