$InputFileName

$InputFileName

is a global variable whose value is the absolute file name of the input file from which input to the Wolfram Language is currently being sought.

Details

Examples

Basic Examples  (2)

Loading a file:

In[1]:=
Click for copyable input

During interactive input, $InputFileName is "":

In[1]:=
Click for copyable input
Out[1]=

See Also

$Input  Get  $Path  DirectoryName  FileNameJoin  $BatchInput  $CurrentLink  $ParentLink

Tutorials

Introduced in 2010
(8.0)