How do I copy the path of a folder?


How can I copy the path of a folder to the clipboard? I notice there’s a “copy path” option, but it only seems to work for files. I need a way to copy paths of folders as well. Some of these folders are empty, so I can’t simply use workarounds like selecting a file and editing it, or creating a new file just to copy the path, as that would be too cumbersome, especially when I need to do this multiple times.

I’ve noticed that I can drag and drop a folder into a file to insert the folder path, but it doesn’t seem to work for all folders for some reason.

Please see the video attached. Despite dragging and dropping, the path isn’t pasted. And yes, the file is in editable mode. (71.3 KB)

1 Like

On each note, there is a “Show in system explorer” option. This will open your system file manager, from where you can copy pathnames to the clipboard.

Obsidian internally does not essentially work with folders as an organization system. If will retrieve your file independent on the folder in your vault where it is stored. Obsidian will only use relative paths for disambiguation in case multiple files havethe same file name.

I should mention that I did not download the zip file to watch a video, so the entire scope of the issue may not be clear to me.

Copying from the file explorer does not work, I am on Windows and the slashes are reversed in Windows. I need to use this in a code block with a Obsidian proper internal file path

On Windows indeed this will not be possible.

Rereading again your problem, I wonder where you see that “copy path” option. I do not have such option in the right-click menu of a file or folder in the File explorer pane. I also do not see such option in the menu under the three vertical dots on the top right of a note.

What drag and drop of a file from Obsidian file explorer to a note does for me, is create a link. With “Wikilinks” in “Options” “Files and links” turned on (the default), wikilinks are created as [[Name of note]].

Obsidian does not work with folders. It only allows you to organize your notes in folders. For Obsidian, the note can live anywhere in your vault.

Dragging a note from the Obsidian file fxplorer into a note will not include a link, unless a note with the same name exists elsewhere. Then, a relative path is inserted for disambiguation, e.g [[literature/note]] to distinguish from a note [[note]] living in the root folder. So this certainly is not a real method to obtain a path.

At this time, your only help would appear to be a community plugin. I looked a bit myself but I cannot identify one that allows to retrieve the file path.

1 Like

This works for me, but again this is only for the files.

I am not trying to force Obsidian to work in a way it is not designed for, I just need a path to a folder for some usage related reasons. Clearly the path concept exists given it gives me perfect internal link for a file which includes many folders.

There is no built-in way. This would seem like an excellent Feature Request (if it hasn’t already been made.) Or Plugins ideas

I’ll repeat exactly what vanadium said. The best bet at the moment would be a plugin. I also did a quick search last night when you posted, but I didn’t find anything yet.

Your request is extremely clear. But I wonder if you can give an example of why you’re trying to do it? Would an example help others suggest alternative workarounds?

1 Like

Couple of the plugins I use grab files from those internal folder links/paths.

After testing bunch of extensions I found one that works for me, in case someone else had the same need.

It does not work for folders unfortunately, but this gets half the job done.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.