kaijuu v05

Author: byuu
License: ISC

Overview

kaijuu is a Windows context menu shell extension. The context menu is the list you see when you right-click on a file or folder. kaijuu allows you to add your own custom actions to this menu.

Think of opening an unknown file type: Windows will ask you to associate a program with the file type. From there forward, double-clicking the file will open the file with that program.

kaijuu is a far more powerful version of this same concept. With kaijuu, you can assign as many rules as you want. You can apply the same rule to multiple file patterns. You can have more complex pattern matching for names. You can apply rules to folders. You can specify rules about how to handle single-file versus multi-file selection. You can send custom command-line parameters to the program. You can have rules on a per-user basis. And you can do all of this from an easy-to-use GUI.

Installation

kaijuu comes in 32-bit and 64-bit flavors, you will need to use the one for your operating system. If you are unsure, try running kaijuu32.exe. It will tell you if you need to use the 64-bit version.

Now place the appropriate kaijuu EXE and DLL files into a folder where you intend to keep them. The DLL cannot be moved after installation, otherwise Explorer will not be able to locate the shell extension. C:\Program Files\kaijuu would be a recommended location.

Now run the kaijuu EXE, and click on Install. You must have administrator access to use the kaijuu EXE, as this is necessary to install and uninstall shell extensions.

Removal and Upgrading

To remove or upgrade kaijuu, you must first uninstall the shell extension. Run the kaijuu EXE, and click on Uninstall. You must now close all open instances of Windows Explorer, in order for the DLL to be completely unloaded. In the worst case, restart the computer.

If you intend to upgrade kaijuu, I recommend using the Reset button to erase all saved settings. There is no guarantee of backward-compatibility between kaijuu revisions.

Configuration

The kaijuu EXE not only handles installation and removal, it also handles modifying the rules.

kaijuu stores a unique list of rules for every user account. You are free to modify rules even while kaijuu is installed. They will take immediate effect.

The main interface lists all rules, sorted in order of their priority. For instance, if two rules match and both are marked as the default action; the item higher in the list will be marked as the default. You can also quickly determine if the extension is currently installed.

Append will add new rules, Modify will edit an existing rule, Move Up and Move Down can be used to modify the priority ordering, Remove can delete the selected rule, and Reset can delete all rules.

Rules

You can have as many rules as you like. You will see every matched rule in the context menu when you right-click on files or folders.

Name is the string that will show up in the context menu. It would be wise to name the rule something like "Open with X" or "Edit with Y"

Pattern is a semicolon-separated list of patterns to test the selected file or folder names against. You must specify one or more patterns.

Example 1: *.txt;*.doc will match anything ending in .txt or in .doc.

Example 2: * will match everything always.

Example 3: Manifest will only match items named Manifest.

Example 4: *.?? will match any two-letter extension, such as .gb

Command is the program to be executed when a rule is activated. You can use the Select button to quickly navigate to a program to use.

Note the way the program name is typically quoted, for instance "c:\my program.exe". If there is a space in the path, this is required to differentiate the program name from its arguments. If you were to type your own rule, you could take advantage of two things: first, the PATH command-line variable allows specifying system programs without the full path. For instance, "cmd" will invoke the command-prompt; and second, if the program path contains no spaces, the quotes are no longer necessary. So you could say cmd to invoke the command-prompt.

After the program name, you can specify the program arguments. kaijuu has many special identifiers built-in, that are replaced with the file and/or folder names that were selected. When using the Select button, {file} is automatically appended for convenience, which should be sufficient for most cases. You can of course customize the rule afterward with the following identifiers:

{name}      = c:\path\file.txt
{pathname}  = c:\path
{filename}  = file.txt
{basename}  = file
{extension} = txt

{path}  = "c:\path"
{file}  = "c:\path\file.txt"

{paths} = "c:\path1" "c:\path2"
{files} = "c:\path1\file1.txt" "c:\path2\file2.txt"

Note that if you use the first group, you must add your own quotes around the identifiers, eg notepad "{name}".

If the command includes {files} or {paths} within the string, then kaijuu will match this rule when one or more files are selected. If neither of these patterns are found, then kaijuu will only check the rule if a single file is selected.

You will want to use {file} and {path} for programs that can only open a single item a a time; and {files} and {paths} for programs that can open multiple items at the same time, such as music players.

Default Action, when checked, will mark this rule as the default action to take when a file or folder is double-clicked on.

Match Files will allow selections with files in them to be valid. If a file is selected without this checked, the rule will fail.

Match Folders will allow selections with folders in them to be valid. If a file is selected without this checked, the rule will fail.

Assign will create the new rule or modify an existing rule, depending upon which button you clicked from the main window.

Caution: be very careful when using a pattern of * along with Default Action checked. For instance, you could find that double-clicking executables no longer opens then, and requires you to use the right-click context menu. In the worst case, you will have to reboot into safe mode and delete the rule or kaijuu DLL.

Rule Examples

NameDefaultMatchPatternCommand
Open terminal hereNoFolders*cmd /k cd /d {path}
Edit MakefileYesFilesMakefilenotepad {file}
Play song(s)NoFiles*.mp3"c:\winamp.exe" {files}
Load as Game FolderYesFolders*.fc;*.sfc;*.gba"c:\bsnes.exe" {path}