VLC context menu not working

In version 12.21 x64, I have VLC Media Player x64 installed. The Context menu appears in listers, but if I right-click a playable file (.mp4, .avi, .wmv, .flac) and choose "Play with VLC Media Player", I consistently get the "This file does not have an app associated with it for performing this action" message. If I open Settings->File Types and find .mp4, the entry is there and the context menu commands are correct. If I open a command prompt and type in the same command, filling in the file name, it starts the player and works fine. I've also changed the context menu display text to confirm that I'm looking at the correct context menu entry. This happens for both the "Play with VLC Media Player" and "Add to VLC Media Player Playlist" context menu items. If I choose the Open with... context menu item, and choose VLC Media Player, it works fine. Only the top-level context menu items are broken. This used to work... Any ideas? Let me know if you need more info.

What do the "Play with VLC Media Player" and "Add to VLC Media Player Playlist" commands look like in the editor?

Do they work OK in File Explorer?

Geez it's been so long that I've even opened File Explorer... but interestingly enough those two items don't show up there. Open with... is there and works fine.

Add to Playlist:
"C:\Program Files\VideoLAN\VLC\vlc.exe" --started-from-file --playlist-enqueue "%1"

"C:\Program Files\VideoLAN\VLC\vlc.exe" --started-from-file --no-playlist-enqueue "%1"

This seems to be an issue with Windows pretending another program owns the file type, or overriding it somewhere which Opus doesn't look, and in such a way that anything trying to use VLC's file type fails. (Microsoft keep adding new overrides on top of all the other overrides, every few years, and the file type system is now a complete mess.)

If you right-click a file of the type you are trying to play, then use Open With > Choose Default Program (or Choose Another App, if you're in Explorer), then select VLC and tick Always use this app to open .xyz files, everything works after that point. The menu items appear in File Explorer, and they work in both Opus and File Explorer.

Having anything else assigned as the default player breaks the menu items everywhere (in File Explorer, you can't even see them; in Opus, you can see them but they don't work).

What exactly the shell is doing, and why it hides those items until then, I am not sure.

If you want VLC as your default player, specifying it as such via the Open With menu will fix things.

If you don't want VLC to be your default player, what you can do as a workaround is replace the existing context menu items with ones of the "Run an Opus function" type, with identical commands to the old menu items. Those will not involve the Windows shell when you select them, and work regardless of which player is assigned as the default.


From further investigation, things work in all cases if we pass the video file's string path to the shell, but fail if we pass the IDL path (the shell's custom version of path strings). But there are other context menu items which are the exact reverse, so we can't really win here.

I think it makes sense to leave things as they are, since these menu items also do not work in File Explorer unless the default program is changed to VLC. Using Opus-specific menu items (described above) is probably the best workaround.

I'd also say this is a bug in Windows, since the string and IDL paths ultimately point to the same files, and it should not matter which one is used, but clearly does to some part of the Windows code.

Edit 2:

We'll add a kludge/workaround which detects the VLC commands and makes things work correctly for them, since it's easy enough to do. If similar issues arise with anything else, we can work out a more general pattern.

Thank You. I backed into the same info with more testing. Since I practically never use File Explorer, I took the Lister-Only approach. Rather than adding the function to each file type, I added them to the Movie and Music groups only, after making sure all of my needed types were in the group. Then I went to each file type and deleted the Play and context menu item. These are easily recreated by re-installing VLC. Unfortunately the will also re-appear when there is a VLC update :frowning:

Not sure if this is a Windows bug, or Windows trying to be too smart.

A less labor-intensive workaround will be much appreciated :slight_smile:

1 Like