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

NotebookFileName

NotebookFileName[]
gives the file name of the current evaluation notebook.
NotebookFileName[nb]
gives the file name for the notebook specified by nb.
  • The file name given by NotebookFileName is on the filesystem of the computer on which the notebook front end is being run.
Create a notebook and save it in a file and then open it:
Find the file name for the notebook:
Close the notebook and delete the file:
Create a notebook and save it in a file and then open it:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Find the file name for the notebook:
In[3]:=
Click for copyable input
Out[3]=
Close the notebook and delete the file:
In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
New in 7