Unexpected Results with Obsidian URI at Windows 10 Command Prompt

I’m trying to use Obsidian URI to open notes, or create them, using the Windows 10 Command Prompt. While I can get the commands to open my Obsidian vault, I can’t get a note to open, and creating notes doesn’t seem to accept the title.

Things I have tried

Opening a Vault
This command works as expected Start obsidian://open?vault=Notes. It opens my “Notes” vault.

Opening a note
In Obsidian’s file explorer, I can right-click on a note and “copy obsidian URL” to build my command. For example, I can do this for the file test.md at the root of my vault. However, when I try Start obsidian://open?vault=Notes&file=test it does not open the note indicated. Obsidian opens, but only shows the previously opened note. If no note was previously opened, then Obsidian opens to the “No File is Open” screen.

Creating a note
If I do Start obsidian://new?vault=Notes&name=NewNoteTest Obsidian will create a blank new note, but the name doesn’t work. The new note is not titled NewNoteTest as indicated but rather Untitled or Untitled 2 etc.

In my case everything is working. Did you put the URI in some "?
EDIT:
Okay never mind, I used the new Windows Terminal which uses powershell by default. The issue is the cmd, because it cuts after the &. Using " only opens a new cmd???

Ah yes thank you for pointing that out. I forgot that the ampersand is a character that needs to be escaped. This can be done for cmd using the ^ caret character. So, with that in place, here is a working example, with the ^ added before the &

Open the vault and then it goes on to make the new note with the specified title.

Start obsidian://new?vault=Notes^&name=NewNoteTest

or, to use quotes, without the need to escape the ampersand character:

START "" "obsidian://new?vault=Notes&name=NewNoteTest"

Thanks for your help!

1 Like

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