Custom protocol opening your application

When you want to give users the ability to quickly navigate to your WinForms application by URL with custom protocol, you just have to define your protocol in a simple registry key 🙂

See, for the Notepad example shown by MS.

Windows Registry Editor Version 5.00

@="URL:Note Protocol"
"URL Protocol"=""




@="\"C:\\WINDOWS\\note.cmd\" \"%1\""

… oh, notepad does not uderstand the URL, so here note.cmd

@FOR /F "tokens=1* delims=:" %%a IN ("%~1") DO start notepad.exe "%%b"

Leave a Reply

Back to Top