Jump to content

Add WinRar SFX to context menu?


MCT

Recommended Posts


Sometimes I'm just amazed by myself :P It took a while to get the right command (although you'd probably figured it out yourself if you've checked WinRAR's help :)), but the registry tweak worked right away :D, so here it is:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\WinRAR.SFX]
@="Create &SFX Archive"

[HKEY_CLASSES_ROOT\Directory\shell\WinRAR.SFX\command]
@="WinRAR a -sfx \"%1.exe\" \"%1\""

1) Note that if you're using cascaded menu-items, you can't put it under that menu.

2) For some reason it will shorten some names. I can't find a pattern in it, because it will save "System Volume Information.exe" (25 chars long), but it won't save "Documents and Settings.exe" (22 chars long). I don't know if this is a WinRAR bug, or if it has something to do with my code.

Link to comment
Share on other sites

I haven't tried this, but ideally you'd want more switches, but even then, just about every time I make a winrar sfx, I need some different options ie: where to extract (full path, curr dir, temp dir, ...) and if to run an exe after. And there's obviously no way to make it guess what you want for you. Unless you just need some "make a basic sfx" (no comments or such in it), then sure, why not. And even then I'd add at least the switches for compression level and such. Either ways, making a sfx only takes an extra 2 clicks.

Link to comment
Share on other sites

hey :D

thanks 4 the -sfx switch, i must have looked over it lastnight when i read the help file :P

but, EVERYTIME i extract it, its wanting 2 make a folder DOCUME~1\Administrator\Desktop instead of adding the file to the desktop :S what am i missing? i believe ive looked @ all switches, its late & ive got done work not long ago, so im kinda tired, its probly something small on my part

EDIT: all i want this right click 4 is 2 hide all & overwrite all & 2 extract 2 current folder, i can always edit it manually if i need 2, this will be just a "shell" :)

thanks :D

Link to comment
Share on other sites

I think making a winrar compression profile is the best way to accomplish the above.

Here it is:

1. apply the HKCU registry file attached to this post (it modifies the default settings/profile of winrar).

2. that's all

a. now you just right-click on any set of files or folder

b. and choose "add to archive".

c. modify file-name.exe to what you want (if at all)

d. click "OK" in that dialog-box to create the SFX.

Do post back on the progress.

wrar_profile.reg

Link to comment
Share on other sites

hey :D

thanks prathapml that kinda helps :P

when i have this.. it adds ALL files when i rightclick a single file to "name.exe"

[HKEY_CLASSES_ROOT\*\Shell\Winrar SFX\Command]
@="WinRAR a -sfx \"%1.exe\"

but if i have this

[HKEY_CLASSES_ROOT\*\Shell\Winrar SFX\Command]
@="WinRAR a -sfx \"%1.exe\" \"%1\""

it ONLY adds the single file but extracts 2 a short foldername DOCUME~1\Administrator

any ideas how i can make it extract properly :)

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