Tuesday, May 5, 2009

How to - create a right click shell command in explorer

For many times I wanted to have available a simpler method to manage certain files within explorer interface (we are discussing about Windows XP, but should work also in Vista).

For example the ".001" files and so on, related to old WinRAR archives.
First you should right click on the ".001" file, choose "open with..." and select "WinRAR" from your available executables. Now, you can OPEN ONLY the .001 files which should relate themselves to the other .002, .003, ... files and the rar interface is opened.

From that interface, you can choose the "extract" command, or simply drag&drop your files outside of the rar window, in whichever folder you want.

So, this is not a simple and fast solution, isn't it? Because you have to do it each time for every split archive.

A much convenient solution is to create only once a command and select that command for the archive you want by choosing it from a shell menu (right click).

First, we have to create the registry entries: manually, or creating a .reg file in which we put the commands.
You might say that it's the same, with both methods, but you can save the .reg file and use it every time you re-install the operating system, so you don't have to remember so much details. Or, create one .reg file for each command you like.

Create a text file somewhere. Choose a descriptive file name for it. Work only with Notepad or another simple text editor (Microsoft Office Word is not good for this and not even Wordpad).

- right click on your desktop, choose "NEW" and then "text document";
- rename "New Text Document.txt" in "extract with rar.txt"

We will keep for the moment the extension .txt in order to work faster.

- open the "extract with rar.txt" file by double click on it

Paste in your .txt file the following text:
Windows Registry Editor Version 5.00

@="&EXTRACT with WinRAR"

@="C:\\Program Files\\WinRAR\\winrar.exe e -r \"%1\""

@="EXTRACT &with WinRAR"

@="C:\\Program Files\\WinRAR\\winrar.exe e -r \"%1\""
NOTE: paste only the text between the arrows --> and <--
NOTE2: instead of "directory", you can put "folder" and still works

STEP 3 Modify the path to the Winrar executable as it is available on your system. Please note that the backslash "\" characters form the path must be double.

STEP 4 Save the .txt file by "Ctrl + S" keyboard command or by "File" -> "Save" menu option.

Rename the .txt file in .reg file.
Right click on the "extract with rar.txt" file, choose "rename" and change the "txt" extension into "reg".

Depending on how is set your operating system (again, we are talking about Windows XP), double click on the .reg file and select "open" or right click on it and select "merge".

Select "YES" on the warning texts and that's it!
The "EXTRACT with WinRAR" command is now available when you right click on an old split winrar archive.
And also for every other type of files, but it will not work for them.

Now, when you have a split archive which begins with .001 for the firs part of it, you can simply right click on this first file of the archive and select the "EXTRACT with WinRAR" command from the shell menu.