(e-mail address removed):
Chmdump works like a charm. The .exe is 35KB of pure KISS.
KISS is excellent.
Might seem ironic, but I'm going to indulge in un-KISSING the matter
of its usage. Justification being that another value is minimizing
overall labor. I like to be able to configure oft-used commandline utils
for single-click execution. So that I do not have to undergo the labor
of typing commands. So I looked into doing that for this one.
The goal is that when you have a chm before you, you can send it to a pif
shortcut in my sendto, or can click an action in your explorer menu, and
that then the extraction will happen automatically.
So we need a batch file for this. The design I chose was to use a preset
folder name. The name I used here was "cmanual." So if you click on a chm
in a program's folder, and have integrated this batch, a subfolder gets
created with that name, which will contain the web files from the extracted
chm.
Btw, I did not specify the location on disk of chmpdump.exe in my batch,
since I'd put that exe in my path (one can drop it in windir etc).
--------------------------chmextr.bat-----------------------------
@echo off
:: note - this is specific to w9x's command.com
:: change to drive and directory of target
%1.\
cd %1\..
:: the command itself
chmdump %1 cmanual\
:: this next part is because I didn't see need for those binary files
cd cmanual
deltree/y $*
deltree/y #*
:: this last part opens up explorer at the new cmanual folder.
:: mostly annoying, on systems where spawsn a new instance of explorer
:: in which case this last line probably best deleted
start .
--------------------------/chmextr.bat-----------------------------
I made a .pif shortcut to the batch. This since the .pif lets me set
properties to not have a lingering console window get left behind after
use ("close on exit"), and also lets me have a custom icon.
1. Put in SendTo
The pif (or the bat) can be put in the sendto folder. Maybe in a subfolder
in sendto, one named eg chm, so not to crowd the root level of sendto. Then
selecting a chm and sending it that shortcut, the extraction gets done.
2a. Registry change: Put in explorer context-menu
For frequent use, this could be promoted to the explorer context menu. By
making a new verb under the chm filetype, and using <path>\chmextr.pif %1
as the command.
2b. Registry change: Create chm filetype keys if system doesn't have it
For the non-msie machine, I would guess that there doesn't exist any chm
filetype defined in the registry. The .reg file below would create the
needed keys.
SHORT VERSION:
----------------------chmfile.reg---------------------------------
REGEDIT4
[HKEY_CLASSES_ROOT\.chm]
@="chmfile"
; set the extension association to our filetype key
[HKEY_CLASSES_ROOT\chmfile\shell]
@="Extract"
; set the default action to the verb Extract
[HKEY_CLASSES_ROOT\chmfile\shell\Extract\command]
@="drive:\\folder\\chmextr.pif %1"
; !! set path to the .pif, and use double slashes
;
----------------------/chmfile.reg---------------------------------
LONG VERSION (includes optional values, more annotations):
----------------------chmfile.reg---------------------------------
REGEDIT4
// Extension key
[HKEY_CLASSES_ROOT\.chm]
@="chmfile"
; set the extension association to our filetype key
; do not do this on a system that already has a filetype key associated with .chm.
; instead you would add an action under the filetype key that's already in place
// Filetype key
[HKEY_CLASSES_ROOT\chmfile]
; @="compiled html file"
; optional, set a long description for display in explorer
[HKEY_CLASSES_ROOT\chmfile\DefaultIcon]
; @="F:\\PIX\\regd\appicon.ico"
; optional, set an icon for explorer view
; change the path to the icon you want to use
[HKEY_CLASSES_ROOT\chmfile\shell]
@="Extract"
; set the default action to the verb Extract (for double-click in explorer, etc)
[HKEY_CLASSES_ROOT\chmfile\shell\Extract]
; @="Extract Contents"
; optional, set a long description of this verb for display in explorer
[HKEY_CLASSES_ROOT\chmfile\shell\Extract\command]
@="D:\\TOOLMAP\\w99\\sendto\\chm\\chmextr.pif %1"
; !! change path
; put the path to your pif here (or your batch itself, if not using a pif)
; make sure to use the double-slashes in the path
;
----------------------/chmfile.reg---------------------------------
Observe that this .reg requires being customized, before ready for use.
First, the paths need to be set. I left in my own paths here, as example
of how looks with the syntax, and also to stand out as something to fix.
The crucial path that needs to be set is the one to the .pif file. (As
well, if wanting a special icon display in explorer, then path there needs
to be set, too.)
Second, I've ;commented out the optional values. So if want to apply one of
those values (as is, or customized), then need to uncomment, and re-merge.
; @="Extract Contents"
@="Extract CHM Contents"
What is handy is to have a text editor associated with .reg (the tiny
Win32pad for example), where you can view or edit what you want in the
file, then click on the execute command from within the editor, to do
a merge.
Important. The .reg is !!NOT for systems already having chm handling.
Merging it there would commit the mean theft-of-associations crime. For
that situation, it'd be best to use a GUI tool. A context-menu editor,
or Windows' own filetypes dialog, or a registry editor. Use one of those
to create a new action under the existing chm filetype, and there, put
in the path to the pif, with the %1.