Jump to content

Add Makecab and Expand in SendTo


jdoe

Recommended Posts

I guess maybe it is cause i put ModifyPE.exe in system32 as i downloaded the file, but i see that in the vbs the file called is modifytype

FOR %%I IN (.EXE .DLL .SYS .OCX .CPL .COM) DO IF /I "%%I"=="%EXT%" MODIFYPE.EXE %~fs1 -c

I guess if i rename it to MODIFYPE.EXE it shoudl works. I will give it a try ....

Weeb,

Nope i tryed, still doesn't work. ummmm, maybe a path problem, but expand should not work as well, or it does.

Link to comment
Share on other sites


@webservices

I made modification to batches. Now you will have a message if an error occurred. It's gonna be easier for me to know whats the problem.

Dont' forget that the original file is deleted, if you send a file to Makecab the file is deleted and a new compressed one is created.

If you want to keep the original file like SyMoNsAyS said, delete line DEL /F /Q %1

@sleepnmojo

ModifyPE don't return an error code but if you look at the batch, I found a workaround.

Link to comment
Share on other sites

@jdoe

Thx for your fast updates, respect .... Thanks to your logs, i do suspect a corrupt profile. I have a fresh install in a VMware, i am gonna test it in here and give you a feedback.

here are the logs i got : The good part is that my files are not deleted anymore :)

Concerning teh expand focntion, i have no probleme.

1) makecab WINNT32U.DLL

Microsoft ® Cabinet Maker - Version 5.1.2600.0

Copyright © Microsoft Corporation. All rights reserved..

EnsureDirectory: Cant create file: C:\DOCUME~1\chirs\BUREAU\COMPBA~1\ADDMAK~1\NOUVEA~1\WINNT32U.DLL\CAB03540.TMP, errno=

2, _doserrno=3, GLE=3

ERROR: Path is invalid: C:\DOCUME~1\chirs\BUREAU\COMPBA~1\ADDMAK~1\NOUVEA~1\WINNT32U.DLL

Appuyez sur une touche pour continuer...

2) makecab winspool.exe

ERROR - MODIFYPE CAN'T PATCH winspool.exe

Appuyez sur une touche pour continuer...

EDIT : Ok i did a new try in a clean installation of XP, and i got the same error.

It's like a path problem, so maybe the fact my OS is french with accentuated letters, that put a mess in it.

I am waiting for your investigations ....

Link to comment
Share on other sites

@webservices

Man you're not lucky, in fact there is 1 bug I can solve and 1 I can't.

1) WINSPOOL.EXE is not a Win32 executable file so it don't need a CRC header edits and by the way what kind of hacking are you doing on this file. You should not need to play with this file or there is something I don't know about this file. If you give me a good reason, I will try to do something for that.

2) For WINNT32U.DLL (and all Win32 executable file) the problem is a behavior of MAKECAB.EXE and it's not a path problem. It seem to be a french Windows problem (j'ai la même erreur que toi mais j'ignore si c'est le SP1 ou Windows francais). I have few ideas for solving this problem. I'm working on it...

Link to comment
Share on other sites

;) i am sure you gonna make it .... I can still use a cmd btach to launch some makecab command when i need it. but your vbs is quiet cool and easy to use.

For the WINSPOOL.EXE, my fault, i just took an .exe without looking at if it was win32 executable or not. Sorry to have confused you. Who would like to hack that file ?

A french ? oh god, we are mad but not at this point yest :)

Catch you later on.

Weeb. :hello:

Link to comment
Share on other sites

@webservices

Both problems are solved. The script will know what kind of file it is and will not display an error when there is none. I know there is no utility to decompress winspool.exe but anyway now you can decompress and recompress any file.

I made test with english and french Windows and it worked well. Let me know if you still have errors but I think this time it will be ok.

;)

Link to comment
Share on other sites

@jdoe.

sorry not to have responded to you earlier, but i have been away for a few days.

First of all, thx ever so much cause now it is working perfectly on my french OS, and be sure I am using your scipts for my custom XP cd.

Best wishes on your next developments .....

Weeb,

Link to comment
Share on other sites

@webservices

Great :hello:

@RyanVM

I have tried to do so but there is a bug with the french character "é" - "É" :angry:

and I need these batch to work with both french and english Windows.

It's surely possible with an external .EXE program (a kind of renamer.exe) but I want a simple batch for that.

With no bugs with french characters I would do something like this to convert file name to uppercase...

SET UCN=%1
SET UCN=%UCN:a=A%
SET UCN=%UCN:b=B%
SET UCN=%UCN:c=C%
SET UCN=%UCN:d=D%
SET UCN=%UCN:e=E%
SET UCN=%UCN:f=F%
SET UCN=%UCN:g=G%
SET UCN=%UCN:h=H%
SET UCN=%UCN:i=I%
SET UCN=%UCN:j=J%
SET UCN=%UCN:k=K%
SET UCN=%UCN:l=L%
SET UCN=%UCN:m=M%
SET UCN=%UCN:n=N%
SET UCN=%UCN:o=O%
SET UCN=%UCN:p=P%
SET UCN=%UCN:q=Q%
SET UCN=%UCN:r=R%
SET UCN=%UCN:s=S%
SET UCN=%UCN:t=T%
SET UCN=%UCN:u=U%
SET UCN=%UCN:v=V%
SET UCN=%UCN:w=W%
SET UCN=%UCN:x=X%
SET UCN=%UCN:y=Y%
SET UCN=%UCN:z=Z%

SET UCN=%UCN:é=É%
SET UCN=%UCN:à=À%
...
..
.

BTW this is working for the english Windows - if you want a makecab.cmd with this code in it let me know and I will post a makecab.cmd for english Windows only - for uppercase file name (compressed)

Link to comment
Share on other sites

I lile makecab.cmd very much :thumbup , but I have 2 questions:

1) How can I put the command under context menu rather than under SendTo?

2) It seems that the makecab.cmd can cab only one folder at a time. How can I do it for several folders (surely in the same root)

:blushing:

Link to comment
Share on other sites

@QKnet

1) You need to add entries in registry to put this command directly in context menu but these scripts are made to be in SendTo folder.

2) What you're asking is part of a complete application. Only one selection can be made with these scripts so you can copy want in your cab (files and folders) in one folder and make a cab with this folder.

@RyanVM

If your Antivirus software is cool with vbscripts, I added vbscripts in the download package to do the same things as the batches and it puts compressed file name in uppercase characters.

Link to comment
Share on other sites

@RyanVM

SET CONVERT_THIS="This is a test"
SET UCN=%CONVERT_THIS%
SET UCN=%UCN:a=A%
SET UCN=%UCN:b=B%
SET UCN=%UCN:c=C%
SET UCN=%UCN:d=D%
SET UCN=%UCN:e=E%
SET UCN=%UCN:f=F%
SET UCN=%UCN:g=G%
SET UCN=%UCN:h=H%
SET UCN=%UCN:i=I%
SET UCN=%UCN:j=J%
SET UCN=%UCN:k=K%
SET UCN=%UCN:l=L%
SET UCN=%UCN:m=M%
SET UCN=%UCN:n=N%
SET UCN=%UCN:o=O%
SET UCN=%UCN:p=P%
SET UCN=%UCN:q=Q%
SET UCN=%UCN:r=R%
SET UCN=%UCN:s=S%
SET UCN=%UCN:t=T%
SET UCN=%UCN:u=U%
SET UCN=%UCN:v=V%
SET UCN=%UCN:w=W%
SET UCN=%UCN:x=X%
SET UCN=%UCN:y=Y%
SET UCN=%UCN:z=Z%

ECHO %UCN%

The ECHO command will display...

"THIS IS A TEST"

-----------------------------------------

This is how MAKECAB.CMD would look with uppercase conversion

@ECHO OFF
ECHO.

SET UCN=%~f1
SET UCN=%UCN:a=A%
SET UCN=%UCN:b=B%
SET UCN=%UCN:c=C%
SET UCN=%UCN:d=D%
SET UCN=%UCN:e=E%
SET UCN=%UCN:f=F%
SET UCN=%UCN:g=G%
SET UCN=%UCN:h=H%
SET UCN=%UCN:i=I%
SET UCN=%UCN:j=J%
SET UCN=%UCN:k=K%
SET UCN=%UCN:l=L%
SET UCN=%UCN:m=M%
SET UCN=%UCN:n=N%
SET UCN=%UCN:o=O%
SET UCN=%UCN:p=P%
SET UCN=%UCN:q=Q%
SET UCN=%UCN:r=R%
SET UCN=%UCN:s=S%
SET UCN=%UCN:t=T%
SET UCN=%UCN:u=U%
SET UCN=%UCN:v=V%
SET UCN=%UCN:w=W%
SET UCN=%UCN:x=X%
SET UCN=%UCN:y=Y%
SET UCN=%UCN:z=Z%

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 "%UCN%"
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 "%UCN%.CAB" *.*
IF NOT %ERRORLEVEL% EQU 0 PAUSE
:END

I hope this will help you for your other batch files

:hello:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...