Upon closing the last notebook Mathematica opens the notebook file MathematicaNavigator.nb
or MathematicaNavigatorTrial.nb
(if you are using a trial version) or MathematicaNavigatorStudent.nb
(if you are using a student version). These files reside in [prefix]/Wolfram/Mathematica/8.0/SystemFiles/FrontEnd/TextResources
. That path name is hardcoded into the Mathematica binary. If Mathematica really doesn't have an option to disable the welcome screen completely (it likely doesn't), the only solution I see is to modify the contents of MathematicaNavigator.nb
to make it exit Mathematica immediately. Before proceeding with modifying that file, be sure to disable the display of the welcome screen at startup time.
After you have disabled the welcome screen at startup, either by unchecking "Show at startup" checkbox on the startup screen or by using Edit | Preferences | System | Show at startup -> New document
, back up the existing MathematicaNavigator.nb
in case something goes wrong. Delete all code from MathematicaNavigator.nb
and replace it with the following:
Notebook[{
Cell["", "", CellDynamicExpression :>
FrontEndTokenExecute["FrontEndQuit"]]
}]
Basically, this represents a notebook with an empty cell having a dynamic handler. It activates when the cell is displayed to user. The handler FrontEndTokenExecute["FrontEndQuit"]
just sends the Mathematica FrontEnd a quit message, just as if you had given the Ctrl+Q
shortcut. By the way, calling NotebookClose[]
instead of FrontEndTokenExecute["FrontEndQuit"]
will always crash Mathematica with SIGSEGV on my machine (Mathematica 8.0.4.0 / Debian Wheezy 64-bit).
Another side effect is an immediate exit when About | Welcome screen
is diplayed. I believe, this code could be improved to correctly detect circumstances under which MathematicaNavigator.nb
was called.