Harry,

I think you're putting the entries for files in the wrong place.

The * in my instructions was meant literally -- open HKEY_CLASSES_ROOT, and
find a key called * (it's the first child of HKEY_CLASSES_ROOT on my XP
system).  Open that, and find a child called "shell", creating it if it
doesn't exist.  Beneath HKEY_CLASSES_ROOT\*\shell, you can create a key
whose name is the name of the menu item you want, and beneath that, create a
key called "command".

So for me, the structure looks like:

HKEY_CLASSES_ROOT
|-- *
  |-- (... various other things are here)
  |-- shell
    |-- Open with Emacs
      |-- command

If you click on the "command" key, you can then enter a default value for
that key on the right-hand side.  This should be the command to run.  If you
mis-type this command so that it's not a valid path, or the thing that's at
the path isn't executable, you get errors like you describe getting for
folders.  So double-check your paths.

As far as regedit is concerned, you're just typing text -- it doesn't know
that this is path until it tries to execute it.  So I don't think anything
in regedit would be editing or truncating the path you enter.  Are you sure
you're not hitting some keystroke accidentally?

-Eli


On Tue, Aug 24, 2010 at 11:37 AM, Harry Putnam <rea...@newsguy.com> wrote:

> Eli Daniel <eli.dan...@gmail.com> writes:
>
> > I have two such commands I use -- one for directories to open in dired,
> and
> > another on files.  To get these, you'll need to edit your registry:
> >
> > Under HKEY_CLASSES_ROOT\*\shell, create a key whose name is the text you
> > want to see in the Windows context menus for files.  Mine says "Open with
> > Emacs".
> >
> > Beneath that new key, create another key called command.  Set its default
> > value to the command line to run when you choose the menu item.  Mine is:
> >     C:\tools\emacs-23.1\bin\emacsclient.exe -n -a
> > C:\tools\emacs-23.1\bin\runemacs.exe "%1"
> >
> > As soon as you edit this in regedit, you should have a working
> context-menu
> > item for files.
> >
> > To get this to work on directories, repeat the same exercise, but put it
> > under HKEY_CLASSES_ROOT\Folder\shell.
>
> [...]
>
> I've tried both on an WinXP pro sp/3 machine and found neither thing
> worked.
>
> The attempt for the `file' entry doesn't even show up on right click
> at a common file. (May be path related... see below)
>
> The attempt for the `folder' entry shows up on the context menu
> alright and apparently tries to work, but throws this error:
>
>  `This file does not have a program associated with it for performing
>  this action.  Create an association in the Folder Options control
>  panel.'
>
> I'm a bit reluctant to pursue that, afraid I may not be able to back
> it out so easy if it does harm.  Did you hit this snag?
>
> I've posted small screen shots of the regedit settings for both
> `file' and `folder' here:
>
>   www.jtan.com/~reader/vu/disp.cgi<http://www.jtan.com/%7Ereader/vu/disp.cgi>
>
> Note in the `file' shot... there is one more layer of subdirectory
> than might be guessed from your `file' instruction.  Of course your
> `*' would allow any number of subdirectories.. so I wonder what you
> actually see at that point.
>
> I see:
>  HKEY_CLASSES_ROOT
>  [...]
>    shell/
>      shell/
>          command
>
> Rather than:
>        HKEY_CLASSES_ROOT
>        [...]
>            shell/
>              command
>
> The two levels `shell/shell was like that when I opened that
> area... so not sure if it is significant
>
> -------        ---------       ---=---       ---------      --------
>
> Also note that the value string for the `file' entry will not accept
> the path I enter.
>
>   The path should be:
>          C:\Users\harry\emacs\bin\runemacs.exe "%1"
>
> And as you see, that is what is entered for the folder entry, but when
> I enter that same path above for the `file' entry it becomes reduced
> to:
>  C:\Users\\emacs\bin\runemacs.exe "%1"
>
> with `harry' missing.
>
> I tried it several times... but the tool regedit
>
>  (v.:5.1 (build 2600.xpsp_sp3.100427-1636:Service Pack 3 .. here))
>
> apparently will not accept that full path for the `file' entry, each
> time I enter the full path it is reduced by leaving out `harry'
>
>
>

Reply via email to