Option: Open Last Used Vault or Open Vault Selector

I’m also using Git Bash on my Windows, so I’ve created a workaround script that modifies Obsidian’s obsidian.json file and changes all "open":true values to "open":false before launching Obsidian. That way my Obsidian always launches with the vault selector instead of reopening the last vault. The only downside to this is every time I launch Obsidian, a terminal window shows up for a moment, but it’s just a minor inconvenience to get a very convenient feature.

I’ve figured it might also be helpful to see if I could do it with Windows PowerShell, so people could use this even if they don’t have Git Bash on their systems. Here’s how I’ve set up both versions:

Git Bash version

  1. Create a script file wherever it is convenient for you. Call it something like Obsidian.sh.
  2. Edit the script and put this code in:
sed -i 's/\"open\":true/\"open\":false/g' /c/Users/YourWindowsUserName/AppData/Roaming/obsidian/obsidian.json
start obsidian:

Just remember to replace “YourWindowsUserName” with your actual user name.

  1. Right-click on the script file and click “Create shortcut”.
  2. Put the shortcut file where you want it. You can also pin it to your taskbar or start menu by right-clicking and selecting appropriate option.
  3. Change the name of the shortcut. If you want, you can also change the icon to match Obsidians by right-clicking the shortcut, going into Properties, clicking the “Change Icon…” button and putting %USERPROFILE%\AppData\Local\Obsidian\Obsidian.exe as the icon location.

Windows PowerShell version

  1. Create a script file wherever it is convenient for you. Call it something like Obsidian.ps1.
  2. Edit the script file and put this code in:
$filePath = "c:\Users\YourWindowsUserName\AppData\Roaming\obsidian\obsidian.json"
(Get-Content $filePath).Replace("`"open`":true","`"open`":false") | Set-Content $filePath
start obsidian:

Just remember to replace “YourWindowsUserName” with your actual user name.

  1. Right-click on the script file and click “Create shortcut”.
  2. Right-click on the shortcut and go into “Properties”.
  3. In the “Target:” field, before your scripts location, put this in:
powershell -noLogo -ExecutionPolicy unrestricted -file 

So your final target should look something like this:

powershell -noLogo -ExecutionPolicy unrestricted -file C:\Obsidian.ps1
  1. Put the shortcut file where you want it. You can also pin it to your taskbar or start menu by right-clicking and selecting appropriate option.
  2. Change the name of the shortcut. If you want, you can also change the icon to match Obsidians by right-clicking the shortcut, going into Properties, clicking the “Change Icon…” button and putting %USERPROFILE%\AppData\Local\Obsidian\Obsidian.exe as the icon location.
7 Likes