Skip to content

Instantly share code, notes, and snippets.

@aykxt
Created February 16, 2021 21:58
Show Gist options
  • Save aykxt/1aff15ba794061b8b4dc47e5aa1175e6 to your computer and use it in GitHub Desktop.
Save aykxt/1aff15ba794061b8b4dc47e5aa1175e6 to your computer and use it in GitHub Desktop.
VLC URL protocol handler for "vlc://" links on Windows
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\vlc]
@="URL:VLC Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\vlc\DefaultIcon]
@="C:\\Program Files\\VideoLAN\\VLC\\vlc.exe,0"
[HKEY_CLASSES_ROOT\vlc\shell]
[HKEY_CLASSES_ROOT\vlc\shell\open]
[HKEY_CLASSES_ROOT\vlc\shell\open\command]
@="cmd /V:ON /c set url=%1 && call set url=%%url:~6%% && start \"\" \"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" --open !url!"
@MarvinXu
Copy link

This works!! Why can't vlc player add this automatically for us on setup?

@sin3point14
Copy link

sin3point14 commented Dec 23, 2024

So recently this wasn't working on both firefox and chrome. For some reason vlc got the url of the form http//..., no :. After some fiddling around with the example at mpv-player/mpv#14506 (comment). I got this to work:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\vlc]
@="URL:VLC Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\vlc\DefaultIcon]
@="C:\\Program Files\\VideoLAN\\VLC\\vlc.exe,0"

[HKEY_CLASSES_ROOT\vlc\shell]

[HKEY_CLASSES_ROOT\vlc\shell\open]

[HKEY_CLASSES_ROOT\vlc\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -WindowStyle Hidden -Command \"& {Add-Type -AssemblyName System.Web;$PARAMS=('--open', '%1' -replace '^vlc://' -replace '^http//', 'http://' -replace '^https//', 'https://'); Start-Process -FilePath \\\"C:\\Program Files\\VideoLAN\\VLC\\vlc.exe\\\" -ArgumentList $PARAMS}\""

other people are also facing this bug:

There is this bug tracker in chromium:

@sin3point14
Copy link

sin3point14 commented Mar 31, 2025

I reset my laptop and this time vlc ended up in the C:\Program Files (x86) directory instead of C:\Program Files 🤷 . So here's another version which works for C:\Program Files (x86)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\vlc]
@="URL:VLC Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\vlc\DefaultIcon]
@="C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe,0"

[HKEY_CLASSES_ROOT\vlc\shell]

[HKEY_CLASSES_ROOT\vlc\shell\open]

[HKEY_CLASSES_ROOT\vlc\shell\open\command]
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -WindowStyle Hidden -Command \"& {Add-Type -AssemblyName System.Web;$PARAMS=('--open', '%1' -replace '^vlc://' -replace '^http//', 'http://' -replace '^https//', 'https://'); Start-Process -FilePath \\\"C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe\\\" -ArgumentList $PARAMS}\""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment