Skip to content

app URI

An app Uniform Resource Identifier launches an app from a URL.
this can be useful if an app wants to open another app.
e.g. clicking calculator:// opens the calculator on Windows

use cases¶

works on Linux, Windows, Android …
also allows opening apps from your browser. great for tutorials

slow command to print all registered URIs reg query HKCR /s /f "URL Protocol" /c
This very slow command lists all URIs found in the registry on Windows:

@For /f "tokens=1* delims=" B
pause

there’s an official list of URIs, so when adding a new one check it’s not already in use.

App URI is similar to COM dispatch

custom app URI¶

from a stackoverflow answer

RegistryKey key;
key = Registry.ClassesRoot.CreateSubKey("foo");
key.SetValue("", "URL: Foo Protocol");
key.SetValue("URL Protocol","");

key = key.CreateSubKey("shell");
key = key.CreateSubKey("open");
key = key.CreateSubKey("command");
key.SetValue("", "C:\\oggsplit.exe");

AI translated to powershell, not yet tested.
believe this needs to run in elevated mode

New-Item -Path "HKEYCLASSESROOT\foo"
Set-ItemProperty -Path "HKEYCLASSESROOT\foo" -Name "" -Value "URL: Foo Protocol"
Set-ItemProperty -Path "HKEYCLASSESROOT\foo" -Name "URL Protocol" -Value ""
New-Item -Path "HKEYCLASSESROOT\foo\shell\open\command"
Set-ItemProperty -Path "HKEYCLASSESROOT\foo\shell\open\command" -Name "" -Value "C:\oggsplit.exe".

```python
import registry

key = registry.ClassesRoot.OpenSubKey("mycalc")
key.SetValue("", "URL: Foo Protocol")
key.SetValue("URL Protocol", "")

key = key.CreateSubKey("shell")
key = key.CreateSubKey("open")
key = key.CreateSubKey("command")
key.SetValue("", "calc")

```

  • [[interwikilinks plugin]]
    • logseq supports interwiki links using [[app URI]], see PR
      It works, but it’s not as neat as [graph:page name](graph%3Apage%20name "graph:page name")