MSFN Forum: Add Makecab and Expand in SendTo - MSFN Forum

Jump to content



  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Add Makecab and Expand in SendTo Rate Topic: -----

#1 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 12 September 2004 - 10:51 PM

-----
EDIT january 9, 2006
-----

CAB Tool 1.8
Cabinet files compression/decompression program, including
Cabinet files creation from folders/subfolders.

v1.8
Better display of error messages.

New way for identifying Cabinet file. Instead of looking at the file
name, Cabinet files are recognize by SetupIterateCabinet API function.

XP Visual Style have been added on form (was not applied as supposed).

Cancel button added.

Improved installer.

-----

The batches and VBScripts are always available but I wrote a program to replace them called CAB Tool.

The program use the SendTo folder like the previous scripts but do not use EXPAND.EXE, MAKECAB.EXE or CABARC.EXE. All API.

Run on Windows 2000 and higher.


CAB Tool details


PECheckSum
Another SendTo folder program to edit checksum of PE files. Do the same as the -c switch of MODIFYPE.
This new version have one advantage over MODIFYPE: file modification date is not updated.

This post has been edited by jdoe: 19 January 2006 - 03:27 PM



#2 User is offline   MCT 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,288
  • Joined: 19-May 04

Posted 12 September 2004 - 11:08 PM

cool :D what is %~dps1 just curious :P

#3 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 12 September 2004 - 11:17 PM

@MCT
When you select a file and click on Makecab in SendTo folder (for example), %1 is passed to this batch (%1 is the full file path).

%~dps1 extract the short path name of the folder where the file is

%1 = d:\folder path\file.txt

then

%~dps1 = d:\folder~1\

;)

#4 User is offline   MCT 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,288
  • Joined: 19-May 04

Posted 12 September 2004 - 11:18 PM

oh, cool :D , i knew what %1 was, just not the other, thanks :D

#5 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,019
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 12 September 2004 - 11:28 PM

Thank you I will make use of it

#6 User is offline   idle.newbie 

  • Junior
  • Pip
  • Group: Banned
  • Posts: 93
  • Joined: 01-August 04

Posted 13 September 2004 - 12:23 AM

another script to makeCab a whole directory, output to parent folder, named folderName.cab, in cmdWindow or Explorer(install cmd in line1&2).

cmdWindow:
cabIt path\to\anyFolder
or without argument to cab current directory and output to parent directory.
cabIt

Attached File(s)

  • Attached File  cabIt.js (1.78K)
    Number of downloads: 470


#7 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 13 September 2004 - 02:20 AM

@idle.newbie - nice script
You put your link to cabIt in context menu in this reg HKCR\Directory
Personnally I put Command Prompt Here in HKCR\Folder
Someone know the difference between these two reg. It looks like they do the same things.

I'm working on something like cabIt for the SendTo folder because I have so much things in Context Menu that's why I'm using SendTo to free some space.
----------------------


I made a modification to MAKECAB.CMD to prevent strange behaviors when selecting a folder by mistake or when the file size = 0
If you have previously downloaded these batch - re-download to make sure you have the good one.

#8 User is offline   idle.newbie 

  • Junior
  • Pip
  • Group: Banned
  • Posts: 93
  • Joined: 01-August 04

Posted 13 September 2004 - 07:56 AM

i don't know the exactly difference, basically HKCR\Folder = HKCR\Directory + HKCR\Drive + and more(like some special shell folder), HKCR\Directory more physical directory, i like HKCR\Folder but not this case(my script may not work correct on specialFolder, and i don't want it to apply on DriveRoot).
SendTo's nice, but my script needs only a directory, SendTo works on File too, too lazy to check for file or directory.

#9 User is offline   sleepnmojo 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 472
  • Joined: 02-March 04

Posted 13 September 2004 - 08:28 AM

Nice batches. You might want to not have it prompt the user for the modifype. Could just have it check for certain files, since not all are executable. Plus the programs need to be in the path, which not everyone knows how to do.

Something I did learn which I didn't know before is how you use modifype. I could never get it to work with the full path. Never tried making it short like you did. I always just did a pushd, then popd back. Still can't get the > NUL to work on it though.

One more thing shouldn't
IF %FSIZE%==0 GOTO END
be
IF %FSIZE% EQU 0 GOTO END


#10 User is offline   SiMoNsAyS 

  • C'mon you apes! You wanna live forever!?
  • Group: Patrons
  • Posts: 3,455
  • Joined: 17-May 04

Posted 13 September 2004 - 08:38 AM

maybe you can help me with this jdoe, it looks stupid but...
@ECHO OFF
dir %1 /-p /o:gn > %SYSTEMDRIVE%\Dir.txt
PAUSE

... this will store the contents of the folder on a %SYSTEMDRIVE%\Dir.txt file, how can i store it in the same folder that i want to print the contents?

#11 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 13 September 2004 - 12:29 PM

@sleepnmojo
Good idea, I will remove prompt and only check for file extension but what are the file that need a CRC header edits - I know EXE, DLL but what are the others (if any) ?
You're right that it's more logical to make numbers comparison with IF %NUMERIC% EQU X but it work with a strings comparison too.
The installer put these batch in system32 so they are in the path.


@SiMoNsAyS
This batch create DIR.TXT with a folder contents (%1) and prevent DIR.TXT to appear in it. Otherwise DIR.TXT would contain DIR.TXT in the listing because you put it in the same directory of the DIR %1 command.

@ECHO OFF
IF EXIST "%~f1\DIR.TXT" DEL /F /Q "%~f1\DIR.TXT"
DIR %1 /O:GN>"%TEMP%\DIR.TXT"
MOVE "%TEMP%\DIR.TXT" "%~f1\DIR.TXT"


;)

#12 User is offline   SiMoNsAyS 

  • C'mon you apes! You wanna live forever!?
  • Group: Patrons
  • Posts: 3,455
  • Joined: 17-May 04

Posted 13 September 2004 - 03:12 PM

@jdoe thanks dude :thumbup
just a bit of my taste but i preffer to add the /A /-P switches to the dir command :P

#13 User is offline   webservices 

  • Junior
  • Pip
  • Group: Members
  • Posts: 54
  • Joined: 04-September 04

Posted 14 September 2004 - 05:19 AM

hi,

I installed your batch but i have a problem using it.
the expand command works perfectly, but when i wanna makecab my dll, the dll disappear like if it was deleted. Even any file i try to makecab vanishes.

Nobody knows what's happening ?


weeb,

#14 User is offline   SiMoNsAyS 

  • C'mon you apes! You wanna live forever!?
  • Group: Patrons
  • Posts: 3,455
  • Joined: 17-May 04

Posted 14 September 2004 - 05:32 AM

@webservices, dll it's deleted by default. if you don't want to, remove this line from makecab.cmd
DEL /F /Q %1


#15 User is offline   sleepnmojo 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 472
  • Joined: 02-March 04

Posted 14 September 2004 - 05:34 AM

webservices, on Sep 14 2004, 05:19 AM, said:

hi,

I installed your batch but i have a problem using it.
the expand command works perfectly, but when i wanna makecab my dll, the dll disappear like if it was deleted. Even any file i try to makecab vanishes.

Nobody knows what's happening ?


weeb,

My guess is either you don't have makecab and modifype in your path, or something goes wrong in them. You can modify makecab.cmd and take out the del statement, and add a pause at the end to see whats happening.

@jdoe - you might want to do a errorlevel check before going on to the next step. modifype -> makecab -> del

#16 User is offline   webservices 

  • Junior
  • Pip
  • Group: Members
  • Posts: 54
  • Joined: 04-September 04

Posted 14 September 2004 - 05:44 AM

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.

#17 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 14 September 2004 - 03:41 PM

@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.

#18 User is offline   webservices 

  • Junior
  • Pip
  • Group: Members
  • Posts: 54
  • Joined: 04-September 04

  Posted 14 September 2004 - 08:13 PM

@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 ....

#19 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 14 September 2004 - 09:04 PM

@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...

#20 User is offline   webservices 

  • Junior
  • Pip
  • Group: Members
  • Posts: 54
  • Joined: 04-September 04

Posted 14 September 2004 - 09:18 PM

;) 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:

Share this topic:


  • 4 Pages +
  • 1
  • 2
  • 3
  • Last »
  • 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