The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,929 other followers

Archive for the ‘Compression’ Category

How to make a self extracting archive runs your setup.exe, 7zip -sfx

Posted by jpluimers on 2020/01/01

For my link archive step by step instruction on the command-line which can be automated:

Via:

–jeroen

Posted in 7zip, Batch-Files, Compression, Development, Power User, Scripting, Software Development | Leave a Comment »

7zip / 7za command-line parameters for highest compression

Posted by jpluimers on 2019/03/14

On my systems these so far give the best compression results with 7zip and p7zip 16.02:

-t7z -m0=lzma2:d=1024m -mx=9 -aoa -mfb=64 -md=32m -ms=on

Note the -d=1024m is mentioned on some sites, but is gone around version 16.

Via:

If you want to delete the files after archiving, then use the -sdel switch: -sdel (Delete files after including to archive) switch

If -sdel switch is specified, 7-Zip deletes files after including to archive. So it works like moving files to archive., moves txt files from disk’s directory to a.7z archive.

–jeroen

Posted in 7zip, Compression, Power User | 1 Comment »

7zip on ESXi through p7zip – redux

Posted by jpluimers on 2019/03/12

Steps to get it working on ESXi 6.x with p7zip 16.02:

  1. Copy the output of https://sourceforge.net/projects/p7zip/files/p7zip/16.02/p7zip_16.02_x86_linux_bin.tar.bz2/download to a place where you can reach it through http (as wget on ESXi does not understand https)
  2. Follow the script below

mkdir -p /local/bin
cd /local bin
wget http://192.168.71.62/esxi/netcologne.dl.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_x86_linux_bin.tar.bz2
bzip2 -d p7zip_16.02_x86_linux_bin.tar.bz2
mv p7zip_16.02/bin/7z* .
chmod 755 7z 7za 7zra

Based on much longer steps involving Windows and an older version of p7zip: 7zip on ESXi through p7zip.

–jeroen

Posted in 7zip, Compression, ESXi4, ESXi6, ESXi6.5, Power User, Virtualization, VMware, VMware ESXi | Leave a Comment »

Locating the 7z.exe command-line tool on Windows

Posted by jpluimers on 2018/09/18

From one of my scripts: it will find a  64-bit 7z.exe if it was installed as part of the 7-zip installer, then run it with the parameters provided to the batch file.

  setlocal
  
:verify7zip
:: registry trick from http://www.robvanderwoude.com/files/sortdate2_nt.txt
:: extra trick: tokens=2* allows to get the  3rd (and beyond: space delimited!) value in one variable %%b
  for /F "tokens=2*" %%a IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip" /v Path64 2^>nul') do set sevenZipDirectoryPath=%%b
  call :checkMissingSetting sevenZipDirectoryPath     || goto :help
  
  set sevenZipExeFilePath=%sevenZipDirectoryPath%7z.exe
  if not exist "%sevenZipExeFilePath%" call :showError "No 7-zip executable at %sevenZipExeFilePath%" || goto :help
  
:run7zip
  "%sevenZipExeFilePath%" %*

  endlocal
  goto :end
  
:checkMissingSetting
  if not defined %1 call :notifyMissingSetting %1 && exit /b 1
  call :showSetting %1
  exit /b 0
  goto :end

:notifyMissingSetting
  echo Registry didn't provide the environment variable "%1"
  goto :end
  
:showError
  :: remove double quotes using tilde trick:
  echo %~1
  
:help
  echo Syntax: %0 7z.exe-commandline-parameters
  goto :end

:end

–jeroen

Posted in 7zip, Batch-Files, Compression, Development, Power User, Scripting, Software Development | Leave a Comment »

calculate crc32 on the command-line using 7z.exe – Using 7-zip hashing to compare directories and files – Sami Lehtinen

Posted by jpluimers on 2018/02/26

Searching 7z.exe calculate crc32 didn’t return any meaningful results, but [WayBackUsing 7-zip hashing to compare directories and files – Sami Lehtinen did help me as I never noticed that somewhere along the line the h command got added to 7z.exe. It’s not even in the documentation, as found by searching for 7zip commandline arguments:

but it is in the command-line help, at least in versions 16.x:

C:\temp>"C:\Program Files\7-Zip\7z.exe" --help

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21

Usage: 7z  [...]  [...]
       [<@listfiles...>]


  a : Add files to archive
  b : Benchmark
  d : Delete files from archive
  e : Extract files from archive (without using directory names)
  h : Calculate hash values for files
  i : Show information about supported formats
  l : List contents of archive
  rn : Rename files in archive
  t : Test integrity of archive
  u : Update files to archive
  x : eXtract files with full paths

–jeroen

Posted in 7zip, Compression, Power User | Leave a Comment »

 
%d bloggers like this: