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

NotebookDirectory

NotebookDirectory
gives the directory of the current evaluation notebook.
NotebookDirectory[nb]
gives the directory for the notebook specified by nb.
  • The directory given by NotebookDirectory is on the filesystem of the computer on which the notebook front end is being run.
Find the name of the directory containing the notebook file for this reference page:
Find the name of the directory containing the notebook file for this reference page:
In[1]:=
Click for copyable input
Out[1]=
There is no directory for a notebook that has been created but not yet saved:
New in 6