[Date Index] [Thread Index] [Author Index]
Re: Directory ? Not the current working one !
Laura Dabene wrote: > Hi > > I need a way to detect the directory a notebook has been saved in, > but none gotten by mean of ?*Directory* seems to be useful. > > As example, if MyNotebook.nb was saved in c:\MyDirectory > I would love to get > > In = WhereDoIDwell > Out = "c:\MyDirectory" > > instead of the current working directory as given by Directory. > > Any hints ? Thanks you a lot. > > Laura > > Hi Laura, Say that the current notebook is called "jm.nb" and is located in the directory "C:\projects\", then the following expression returns the path without the file name. In:= ToFileName[First["FileName" /. NotebookInformation[ EvaluationNotebook]]] Out= C:\projects\ Regards, Jean-Marc