I'm experimenting on Windows 7 and need little assistance.

I've got an app that's listing my duplicates, it's the best I've found. BUT it doesn't show the filenames, only the option to "remove" them.

It does contain the function to "open" the file, but instead of opening with the corresponding program (VLC), I thought I would write I short script that simply pops up an information popup with the correct path & filename.

The idea is simple, make Windows to start the script instead of the "default" application.

My problem is that I have no idea how to tell Windows to run a script instead of loading VLC when something is calling the player for .mp4 (for example)

2 Answers 2

  • First open Registry Editor.
  • Go to the HKEY_CLASSES_ROOT\.mp4 key.
  • Make note of the (Default) value.
  • Use the (default) value identified above and navigate to HKEY_CLASSES_ROOT\<default value>\shell\open\command.
  • Modify the (Default) value found here. This value is what will be executed when an .mp4 is executed. It will look like this "C:\SomeFolder\MyScript.bat" "%1". Note that those two items are surrounded by a double-quote. This prevents spaces in the paths and filenames from causing issues.

Tip: The "%1" in the value contains the full path and filename of the .mp4. It will be passed as the first argument to the script file.

  • +1 for the answer but this has the side affect of forcing a right-click and “open with” on any .mp4 the OP actually wants to open and play. The question is actually asking how to make one program open with a different mechanism. Oct 1, 2020 at 3:34
  • I'm not sure I understand, because under HKEY_CLASSES_ROOT\.mp4 are several sub "directories". and do you mean HKEY_CLASSES_ROOT\.mp4\shell\open\command , that doesn't exist?
    – JoBe
    Oct 1, 2020 at 3:42
  • @Appleoddity is this for right click? I wanted to tell windows to always use the script as soon as anything calls for the .mp4 application..
    – JoBe
    Oct 1, 2020 at 3:45
  • @JoBe changing this registry entry will cause the script to run in ALL circumstances when the .mp4 file is clicked or executed. You asked if you could get a single app to use a script rather than VLC Player. At least that’s what I understood. As long as you don’t mind the extra steps of right-clicking an .mp4 and then choosing “open with” and choosing “VLC player” when you actually want to play an .mp4 then this solution is right. Oct 1, 2020 at 3:50
  • @Appleoddity no, I want the script to intercept all requests for .mp4 .mkv .avi and so on.. instead of vlc
    – JoBe
    Oct 1, 2020 at 3:54

It was pretty easy, open:

Control Panel\Programs\Default Programs\Set Associations

There you can easily change what program / script that are going to be started when you click in any files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .