This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

$BatchInput

$BatchInput
is True if input in the current session is being fed directly to the Mathematica kernel in batch mode.
  • $BatchInput can be reset during a Mathematica session.
  • When $BatchInput is True, Mathematica terminates if it ever receives an interrupt, does not discard input when blank lines are given, and terminates when it receives end-of-file.
In an interactive session, $BatchInput is False by default:
Run a standalone Mathematica kernel with an input file:
Put commands in a file, in this case to evaluate $BatchInput:
Run the command. The session terminates at the end of the file:
The output file contains the value of $BatchInput:
Delete the temporary files:
In an interactive session, $BatchInput is False by default:
In[1]:=
Click for copyable input
Out[1]=
 
Run a standalone Mathematica kernel with an input file:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Put commands in a file, in this case to evaluate $BatchInput:
Run the command. The session terminates at the end of the file:
In[4]:=
Click for copyable input
Out[4]=
The output file contains the value of $BatchInput:
Delete the temporary files:
In[6]:=
Click for copyable input
New in 2