makecab.cmd
;@echo off
;if "%~1"=="" for %%a in (.) do call "%~0" .\ "%%~nxa"& goto :eof
;if "%~2"=="" 2>nul pushd "%~1"||(pushd "%~dp1")& call "%~0"& goto :eof
;set _ddf="%tmp%\makecab.dir.ddf"
;set "_path=%~pnx1"
;set "_name=%~nx1"
;>%_ddf% rem/
;>nul chcp 1251
;setlocal EnableDelayedExpansion
;for /d /r "%~f1" %%a in (*) do (
; set "_dir=%%~pnxa"
; set "_dir=%_name%!_dir:%_path%=!"
; >>%_ddf% echo .Set DestinationDir=!_dir!
; for %%# in ("%%a\*") do >>%_ddf% echo "%%~f#" /inf=no
;)
;>>%_ddf% echo .Set DestinationDir=!_name!
;for %%# in ("%~f1\*") do >>%_ddf% echo "%%~f#" /inf=no
;makecab /F "%~f0" /f %_ddf% /d DiskDirectory1="%cd%" /d CabinetNameTemplate="%~n2.cab"
;del /q %_ddf%
;echo/
;pause
;goto :eof
.new Cabinet
.set GenerateInf=OFF
.set Cabinet=ON
.set Compress=ON
.set UniqueFiles=ON
.set MaxDiskSize=0
.set CompressionMemory=21
.set CompressionType=LZX
.set RptFileName=nul
.set InfFileName=nul
.set MaxErrors=1