makecab, modifype

Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Forum rules
Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it
Post Reply
dirtwarrior
User avatar
FTP Access
Posts: 520
Joined: Thu Aug 24, 2006 12:09 am
Location: Glendale KY USA

makecab, modifype

Post by dirtwarrior »

Is there a program to do these 2 things in 1 package?

RentedMule
Donator
Posts: 937
Joined: Tue Oct 17, 2006 8:26 pm

Re: makecab, modifype

Post by RentedMule »

Yeah. A Batch file.

dirtwarrior
User avatar
FTP Access
Posts: 520
Joined: Thu Aug 24, 2006 12:09 am
Location: Glendale KY USA

Re: makecab, modifype

Post by dirtwarrior »

A friend made one for me
http://www.megaupload.com/?d=UKPGLKKS
Please test and give results.

KenOath

Re: makecab, modifype

Post by KenOath »

dirtwarrior wrote:Is there a program to do these 2 things in 1 package?
There is indeed..!
RentedMule wrote:Yeah. A Batch file.
Exactly..!
it seems that the days of dos & it's simplicity are slowly fading away...

To answer your email regarding this DW, I have 2 batch files that'll do what
you're asking...
1st of all, pull your Win2000 CD out & pull the EXPAND.EXE & MAKECAB.EX_ from
the I386 folder, & extract the MAKECAB.EX_
Put both the expand & makecab into your System32 folder, find yourself a copy
of modifype.exe & place it in the System32 folder as well,
then make 2 batch files as listed below...

Copy this code into notepad & save it as Expand.bat

Code: Select all

@ECHO OFF
ECHO.
IF NOT EXIST "%~1" GOTO END
SET EXT=%~x1
SET LCEXT=%EXT:~-1%
IF /I "%EXT%"==".CAB" GOTO DECOMPRESSCAB
IF "%LCEXT%"=="_" GOTO DECOMPRESSFILE
GOTO END
:DECOMPRESSCAB
MD "%~dpn1"
CD /D "%~dpn1"
CABARC.EXE -o -p X %1
IF NOT %ERRORLEVEL% EQU 0 PAUSE
GOTO END
:DECOMPRESSFILE
CD /D "%~dp1"
EXPAND.EXE -r %1
IF NOT %ERRORLEVEL% EQU 0 (PAUSE) ELSE (DEL /F /Q %1)
:END

Now copy this into notepad as well & save it as makecab.bat

Code: Select all

@ECHO OFF
ECHO.
IF NOT EXIST "%~1" GOTO END
SET EXT=%~x1
SET LCEXT=%EXT:~-1%
IF /I "%EXT%"==".CAB" GOTO END
IF "%LCEXT%"=="_" GOTO END
IF EXIST "%~1\" GOTO COMPRESSCAB

IF EXIST "%TEMP%\modifype.tmp" DEL /F /Q "%TEMP%\modifype.tmp"
FOR /F "tokens=*" %%R IN ('MODIFYPE.EXE %~fs1 -c') DO SET MPEMSG=%%R
IF /I "%MPEMSG%"=="NO ERROR OCCURRED, HAVE A NICE DAY" GOTO COMPRESSFILE
IF /I "%MPEMSG%"=="FILE IS NOT A PE FILE" GOTO COMPRESSFILE
IF EXIST "%TEMP%\modifype.tmp" MOVE /Y "%TEMP%\modifype.tmp" %1>NUL
ECHO ERROR - MODIFYPE CAN'T PATCH "%~nx1"
PAUSE
GOTO END
:COMPRESSFILE

CD /D "%~dp1"
MAKECAB.EXE /D COMPRESSIONTYPE=LZX /D COMPRESSIONMEMORY=21 %1
IF NOT %ERRORLEVEL% EQU 0 (PAUSE) ELSE (DEL /F /Q %1)
GOTO END
:COMPRESSCAB
CD /D %1
CABARC.EXE -m LZX:21 -p -r N "%~f1.CAB" *.*
IF NOT %ERRORLEVEL% EQU 0 PAUSE
:END

Now place both of these files you just made into your System32 folder...
Now make a shortcut for each of them, & place the shortcuts into your
SendTo folder on the machines user account you're using,
EG: C:\Documents and Settings\Administrator\SendTo if you
use the Administrator account, or whatever your account is...
Now right click on a file to either "Expand" it or "Compress" it...
Let me know how you go, via mail preferrably....

dirtwarrior
User avatar
FTP Access
Posts: 520
Joined: Thu Aug 24, 2006 12:09 am
Location: Glendale KY USA

Re: makecab, modifype

Post by dirtwarrior »

I will test it KO

Post Reply