MSFN Forum: Mszip Multiple Files - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Mszip Multiple Files using makecab or cabarc Rate Topic: -----

#1 User is offline   raskren 

  • I ♥ Longhorn
  • PipPipPip
  • Group: Members
  • Posts: 383
  • Joined: 11-September 03

Posted 11 March 2005 - 07:12 PM

Hi, this one has been bugging me for a while. I've got a whole mess of driver files scattered in lots of directories. I'd like to compress all of the appropriate files with makecab to end up with "file.ex_" type files. The problem is that makecab doesn't accept wildcards so makecab.exe *.* doesn't work.

I'm aware of the driver compression script that someone made but these folder structures are so complex that it just makes a mess and I'd rather do it manually.


#2 User is offline   rgreen83 

  • Newbie
  • Group: Members
  • Posts: 38
  • Joined: 28-July 03

Posted 11 March 2005 - 07:31 PM

Maybe compressionbin from the unattended guide?

#3 User is offline   Bâshrat the Sneaky 

  • aka Wim Leers
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,214
  • Joined: 29-October 03
  • OS:none specified
  • Country: Country Flag

Posted 12 March 2005 - 04:12 AM

This is the script that I use. It searches the folder %FOLDER% recursively
 
@ECHO OFF
COLOR FC
TITLE Compressing all drivers...
if %1.==Sub. goto %2

SET FOLDER=YOURFOLDER

FOR /R %FOLDER% %%a IN (*.*) DO (call %0 Sub makeIt "%%a")
REM commands after compressing come here

goto EXIT

:makeIt
setlocal

for %%a in (%3) do set naam=%%~nxa
for %%a in (%3) do set pad=%%~dpa

if /I %naam:~-1%==_ goto end
if /I %naam:~-3%==cat goto end
if /I %naam:~-3%==inf goto end
if /I %naam:~-3%==cmd goto end
if /I "%naam%"=="somefile.exe" goto end

ECHO.
ECHO Compressing %naam%...
set naam=%naam:~0,-1%_
MAKECAB /D CompressionType=LZX /D CompressionMemory=21 %3 "%naam%" > NUL
DEL /F /Q %3

move "%naam%" "%pad%%naam%"
endlocal
goto end

:EXIT
EXIT

:end
 


the IF /I blabla things are exclusions; files that should NOT be compressed



EDIT: some vars are in Dutch :P

naam=name=filename
pad=path

BTW... the cabbed file is placed in the same folder as the original one, the original one is being deleted (deleted by 'DEL /F /Q %3')

#4 User is offline   djbe 

  • Member
  • PipPip
  • Group: Members
  • Posts: 169
  • Joined: 20-October 04

Posted 12 March 2005 - 07:27 AM

Bâshrat the Sneaky, on Mar 12 2005, 11:12 AM, said:

the IF /I blabla things are exclusions; files that should NOT be compressed
<{POST_SNAPBACK}>


And you don't wanna remove the
if /I %naam:~-1%==_ goto end
line, or else it will double compress all files... I also had a shorter version, but it needed to have makecab.exe in the same folder as the batch file...(dunno why, weird windows :P)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy