Difference between revisions of "Windows/VLC"

From braindump
Jump to navigation Jump to search
Line 40: Line 40:
reg import hklm-software-classes-audiocd.backup.reg
reg import hklm-software-classes-audiocd.backup.reg
reg import hklm-software-classes-dvd.backup.reg
reg import hklm-software-classes-dvd.backup.reg
==== Batch script ====
I thought it might be help not typing the commands each time hence I wrote a little batch script to speed up the process.
[[:File:Default-disc-vlc.cmd|default-disc-vlc.cmd]]


[[Category:Windows]]
[[Category:Windows]]

Revision as of 00:21, 17 May 2012

VLC is my favorite media player for the simple reason that it runs on Windows, MacOS X, Linux/Unix and then some without a lot of fiddling. Not just that, it can play pretty much everything that you throw at it.

Making VLC the default AudioCD and DVD player on Windows XP

As the computer support staff of the extended family I had a case where there were problems with playing videos after the installation was done I went my merry way. Only to get another call a week later that DVD's are not playing. Turned out that the Windows Media Player on XP was still the default player. After trying to explain the user to right click the drive icon then select Play with VLC a few times without much success I decided for everyone's sanity to make it the default player.

During VLC installation there is an option called Discs Playback which will add a context menu to AudioCD or DVD disc in explorer. Which is good but does not really offer the comfort of a simple double click on the icon and VLC will play back the disc. To get there we need the reg tool.

Backup existing entries

Always have a plan B so before starting we want to backup the registry entries in question.

reg export HKLM\SOFTWARE\Classes\AudioCD hklm-software-classes-audiocd.backup.reg
reg export HKLM\SOFTWARE\Classes\DVD hklm-software-classes-dvd.backup.reg

When uninstalling VLC these files are needed to restore functionality to Windows Media Player.

Removing the old entries

Now we can remove the old entries if you want to confirm deletion of the keys and sub-keys omit the /f option.

reg delete HKLM\SOFTWARE\Classes\AudioCD\shell\PlayWithVLC /f
reg delete HKLM\SOFTWARE\Classes\DVD\shell\PlayWithVLC /f

And some more stuff not required for VLC in the default value

reg delete HKLM\SOFTWARE\Classes\AudioCD\shell\play /v MUIVerb /f
reg delete HKLM\SOFTWARE\Classes\DVD\shell\play /v MUIVerb /f

Changing the default entries

Now we get down to business and overwrite the default Windows Media Player entries. But first we need to know where VLC is located on the disk. And reg can help us once more with this task.

reg query HKLM\SOFTWARE\VideoLAN\VLC /ve

! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\SOFTWARE\VideoLAN\VLC
    <NO NAME>   REG_SZ  C:\Program Files\VideoLAN\VLC\vlc.exe

Add override the default play function. The PathToVLC needs to be replaced with the value we extracted from HKLM\SOFTWARE\VideoLAN\VLC.
Note: For readability the commands are spread on two lines but they need to be on a single line when entering in cmd.

reg add HKLM\SOFTWARE\Classes\AudioCD\shell\play\command 
  /ve /t REG_SZ /d "\"<PathToVLC>\" --started-from-file cdda:///%1" /f
reg add HKLM\SOFTWARE\Classes\DVD\shell\play\command 
  /ve /t REG_SZ /d "\"<PathToVLC>\" --started-from-file dvd:///%1" /f

Done! Happy Playback!

Rolling back the changes

Ok maybe the experience is lacking and Windows Media Player is the gold standard again. Here is how to restore the to it was before the the start. You did backup did you?

reg import hklm-software-classes-audiocd.backup.reg
reg import hklm-software-classes-dvd.backup.reg

Batch script

I thought it might be help not typing the commands each time hence I wrote a little batch script to speed up the process. default-disc-vlc.cmd