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.
Page 1 of 1
Mszip Multiple Files using makecab or cabarc
#3
Posted 12 March 2005 - 04:12 AM
This is the script that I use. It searches the folder %FOLDER% recursively
the IF /I blabla things are exclusions; files that should NOT be compressed
EDIT: some vars are in Dutch
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')
@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
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
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}>
<{POST_SNAPBACK}>
And you don't wanna remove the
if /I %naam:~-1%==_ goto endline, 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
Share this topic:
Page 1 of 1



Help

Back to top









