Linking to external folders and files

INFO TO PASS ON:

My use case is that I want to link directories into my vault to gain access to files as a quick way to initiate editing the files in the directory.

Keep in mind Obsidian Help does provide some warnings about this. You cannot manage the files, create subdirectories, or do any other maintenance task on those link folders or files. I do not, they are merely for quick links

WARNING ABOUT USING SYMBOLIC LINKS
How Obsidian stores data - Obsidian Help

Symbolic links and junctions - Obsidian Help

DON’T BE CONFUSED BY DRAG’n DROPPED FILES
IF YOU DRAG’n DROP A FILE ONTO THE OBSIDIAN TREE IT WILL COPY THE FILE TO THE OBSIDIAN FOLDER. THIS TECHNIQUE WOULD WORK IF YOU WERE DOING ALL YOUR WORK OUT OF THE OBSIDIAN VAULT DIRECTORY STRUCTURE.

LINK TYO UTILITY TO CREATE THE SYMBOLIC LINK:
, NOTE TO USE THIS BETWEEN SESSIONS YOU NEED TO RUN A SCRIPT AT OBSIDIAN STARTUP TO CREATE THE LINKS. OR ENSURE THE LINKS ARE IN PLACE BEFORE LAUNCHING OBSIDIAN

cresstone.com - Apps -

I USED THIS UTILITY TO CREATE THE LINK AND THE FOLDER APPEARED IN MY INSTANCE OF OBSIDIAN.


STEP-BY-STEP PROCESS TO INITIATE LINKS FROM THE COMMAND LINE:

  1. Open Command Prompt as Administrator:

Press Win + S, type cmd, right-click Command Prompt and
select Run as administrator.

  1. Use the mklink Command

In the Command Prompt, use the following command to create a symbolic link.
Replace the paths with your folder locations:

`mklink /D "D:\OBSIDIAN DATA\PROJECTS\04 - ACTIVE PROJECTS\318 RANS\PDR\PDR BRIEF" "D:\__WORKING DATA\__ACTIVE PROJECTS\318 RANS STARTER WORK\PDR BRIEF"`

Explanation:

  • /D: This switch creates a symbolic link for a directory (folder).
  • The first path ("D:\OBSIDIAN DATA\PROJECTS\04 - ACTIVE PROJECTS\318 RANS\PDR\PDR BRIEF") is where you want the symbolic link to appear in your Obsidian vault.
  • The second path ("D:\__WORKING DATA\__ACTIVE PROJECTS\318 RANS STARTER WORK\PDR BRIEF") is the location of the external folder you are linking.
  1. Check the Symbolic Link:
  • Navigate to the D:\OBSIDIAN DATA\PROJECTS\04 - ACTIVE PROJECTS\318 RANS\PDR folder.
  • You should now see a folder named PDR BRIEF in that location. This is the symbolic link, and it points to the external folder. Any changes you make to the files in this linked folder will be reflected in the original external folder.
  1. Use in Obsidian
  • Open Obsidian and navigate to your vault. The symbolic link should appear as a regular folder, and you can access its contents from within Obsidian.

That’s it! Your external folder is now linked to your Obsidian vault as a symbolic link.

NOTE: YOU WOULD HAVE TO RUN A SCIPT EACH TIME OBSIDIAN IS STARTED TO SETUP THE SYMBOLIC LINKS.
THIS IS NOT A NATIVE OBSIDIAN FUNCTION, A 3RD PARTY PLUGIN WOULD BE REQUIRED:

-TEMPLATER EXAMPLE

// Example script to run at startup
console.log("Obsidian started!");
// You can add more custom logic here

-COMMANDER

OR LAUNCH OBSIDIAN THROUGH A BATCH FILE SCRIPT APP

OTHER HELPFUL INFO
SYMBOLIC LINK APPLICATIONS

cresstone.com - Apps -

arnobpl/SymlinkCreator: A GUI app for creating symlinks, based on mklink (github.com)

Symlink Creator download | SourceForge.net

amd989/Symlinker: Symbolic Link Creator. GUI for mklink, Microsoft Windows symlink utility (github.com)

TUTORIAL
Create Soft and Hard Symbolic Links in Windows | Tutorials (tenforums.com)

HOPE SOME FOLKS FIND THIS USEFUL
BEST REGARDS
-TIM C.

1 Like

UPDATE REGARDING SYMBOLIC LINKS

I noticed if the symbolic link was created with the utility mentioned above:
linkMaker_v1.1.1 that the link is persistent between PC restarts, Eg no need to reinitiate the link with a script.

If you want to remove the symbolic link from your obsidian vault you would use Windows File Explorer to navigate to the obsidian virtual (symbolic linked) folder and delete it.

You will know you are looking at a virtual folder because it will have a short-cut icon attached to it. FYI deleting the virtual folder does not harm the data in the source folder. Please note you can use this same technique for individual files too.

Best Regards
-Tim C.

1 Like