$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.

DetailsDetails

Introduced in 2010
(8.0)