Using a custom URL handler on Windows for any scripting purpose
Similar to the macOS post on this, Windows has the option to setup a custom protocol handler. Part of this requires writing a script to target, but that is usually left for the person implementing this to worry about (custom paths and search options, etc.).
As for putting such a script into use, the main trick is to add the following entries (or similar) to the Registry:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\zettel] @="URL:Zettel Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\zettel\DefaultIcon] @="C:\\Program Files\\ZettelProtocol\\handler.exe,1" [HKEY_CLASSES_ROOT\zettel\shell] [HKEY_CLASSES_ROOT\zettel\shell\open] [HKEY_CLASSES_ROOT\zettel\shell\open\command] @="\"C:\\Program Files\\ZettelProtocol\\handler.exe\" %1"
Save the above as "zettel.reg", and update paths as needed. Then just import the file (double clicking it should do the job), and you have a new protocol available.
That's literally it, nothing else is needed. The "%1" above is the full URI that was activated (all of zettel://202005271955) so the script/program can parse this for a valid link, do whatever searching/database lookups it wants, and then can open the default editor for any file it finds.
It looks like you're new here. If you want to get involved, click one of these buttons!