DirectoryName

DirectoryName["name"]
extracts the directory name from a filename.