DirectoryName

DirectoryName["name"]
extracts the directory name from the specification for a file.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

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
New to Mathematica? Find your learning path »
Have a question? Ask support »