How to launch NEURON by double-clicking on a hoc file

Installing NEURON creates a program group with a few icons, like the one that launches the demo program to show off some of NEURON's capabilities. But sooner or later you're going to want to be able to run NEURON simply by double-clicking on the name of a hoc file in the file manager. Here's a step-by-step guide to help you get this right the first time, with tips for what to do if somehow things didn't go right the first time.

How will I know if I need to do anything about this?

A first time installation for those who use Windows Explorer as the file manager

A first time installation for those who use the Norton NT Tools file manager

I've already tried something that didn't work.


How will I know if I need to do anything about this?

1. Open the file manager ("Windows Explorer" or Norton NT Tools file manager). Make sure the file manager is showing all files, and that it is NOT hiding extensions (resort to View / Options to fix this if you have to). Then navigate your way to the drive and directory where you installed NEURON. On my machine at home, this is d:\nrn\

2. In the left panel of the file manager, go down one directory level and L click on the folder named demo (on my machine, this is d:\nrn\demo ). In the the right panel of the file manager, find the file named demo.hoc and double click on it. One of these outcomes will occur:

  1. If the registry is baffled, Windows will complain. The exact complaint and what to do about it depends on whether you are using Windows Explorer or some other file manager (e.g. Norton File Manager from Norton NT Tools).
  2. NEURON runs, loads start.hoc and you don't need to do anything more. Quick, while your luck is still good, submit a grant proposal!
  3. Something altogether different happened, and it wasn't success. If so, tell me about it (ted.carnevale@yale.edu) and let's see if there's a workaround.


A first time installation for those who use Windows Explorer as the file manager

Then this sequence of steps should work if you're running Win NT 4.0. I've done this successfully on at least a half dozen Win NT machines. Something like this also worked on a Win 95 machine, but that was before I started keeping careful records of installation procedures. However, the sequence of steps was quite similar, if not identical.

Under Win NT 4.0 using Windows Explorer, if you double click on a file name with an unrecognized extension, a window entitled "Open With" will appear.

This window asks what program to use to open demo.hoc. It shows a panel with a list of file names, but none of them is Neuron. Here's what to do.

  1. In this window, L click on the "Other" button. This opens a file browser window.
  2. In the file browser window, navigate to the directory that contains neuron.exe. On my machine, this is d:\nrn\bin
    (the drive letter may be different on your machine).



  3. Once you reach this directory, L click on neuron.exe and then L click on the "Open" button. This closes the file browser window and returns you to the "Open With" window, where you will now see Neuron among the list of registered programs.



  4. Make sure that a check mark appears in the box next to "Always use this program to open this file", and then L click the "OK" button. NEURON will launch, and then it will load and run demo.hoc. And Win NT will know to use NEURON to open hoc files in the future.


A first time installation for those who use the Norton NT Tools file manager

Before installing Norton File Manager, I had already installed NEURON and taught Win NT's registry about hoc files. Installing Norton File Manager caused no problems, so I haven't had the experience of teaching the registry about HOC files under Norton File Manager. However, the File / Associate command in Norton File Manager should probably do the trick.

Alternatively, if you double click on a file with an unrecognized extension, a message like this pops up:

where "example.xyz" would actually be the name of the file you had double-clicked, i.e. "start.hoc" in this case. L click on "Yes" brings up a window called New Association Type, which has three fields that must be filled in for the registry to understand about hoc files.

The Extension field will already have the proper extension. L click in the Description field and type something that will be meaningful to you in the future, as shown above. The Open With field requires no typing, since L clicking on the little yellow whatnot icon (is that a tiny file cabinet? shades of Word 9x's smarmy paperclip!) brings up a browser where you can find your way to d:\nrn\bin or wherever neuron.exe lives. When you're done, the New Association Type window should look something like this

and you can click OK to close window after window until you have exited the Associate command structure, finding yourself back in familiar ground, newly empowered to launch NEURON models by double clicking on hoc files.


I've already tried something that didn't work.

All may not be lost. What happens when you double click on the name of a hoc file in your file manager? Follow the steps described here to find out what to do next.


Address questions and inquiries to ted.carnevale@yale.edu

Copyright © 1997, 1998 by N.T. Carnevale, M.L. Hines and D.B. Jaffe, all rights reserved.