NotebookDirectory

NotebookDirectory[]

gives the directory of the current evaluation notebook.

NotebookDirectory[nb]

gives the directory for the notebook specified by nb.

Details

Examples

open allclose all

Basic Examples  (1)

Find the name of the directory containing the notebook file for this reference page:

Possible Issues  (2)

There is no directory for a notebook that has been created but not yet saved:

If an evaluation was not directly triggered from within a notebook, there will be no directory:

Introduced in 2007
 (6.0)