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

DirectoryName

DirectoryName
extracts the directory name from the specification for a file.
  • If name contains no directory specification, DirectoryName returns .
  • DirectoryName by default uses pathname separators and other conventions suitable for your operating system.
On Windows get the directory string:
Apply DirectoryName two times:
On Windows get the directory string:
In[1]:=
Click for copyable input
Out[1]=
Apply DirectoryName two times:
In[2]:=
Click for copyable input
Out[2]=
New in 3 | Last modified in 7