HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings
. For video files, the File Name N
/ File Position N
key pairs are used (c N
from 0 to 19). For DVD, one DVD Position N
key is used (in the same range; the player manages to save both the DVD ID and the last viewing place in one mysterious digital recording).HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings
. Additional benefits are also in the fact that we do not need to open the player again and do not need to manually enter the name of the bookmark, everything will be done automatically. @echo off reg export "hkcu\Software\Gabest\Media Player Classic\Settings" "%~dpn1.reg"
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\* MPC bookmark] [HKEY_CLASSES_ROOT\*\shell\* MPC bookmark\command] @="E:\\DOC\\prg\\bat\\mpc_bm.bat \"%1\"" [HKEY_CLASSES_ROOT\Folder\shell\* MPC bookmark] [HKEY_CLASSES_ROOT\Folder\shell\* MPC bookmark\command] @="E:\\DOC\\prg\\bat\\mpc_bm.bat \"%1\""
File Name 0
+ File Position 0
or DVD Position 0
. In addition, the script will check the identity of the file argument and the last file in the player's history, so that we do not accidentally leave the wrong tab. ################################################################################ use strict; use warnings; use Win32::TieRegistry; ################################################################################ $Registry->Delimiter("/"); my $movie = shift(); ################################################################################ if ($movie && -d $movie) { open(OUTPUT, '>:raw:encoding(UTF16-LE)', $movie . ".DVD.reg") or die "Cannot create the .reg file: $!\n"; print OUTPUT "\x{FEFF}Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CURRENT_USER\\Software\\Gabest\\Media Player Classic\\Settings]\r\n", '"DVD Position 0"="', $Registry->{'HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings//DVD Position 0'}, "\"\r\n\r\n"; close(OUTPUT) or die "Cannot close the .reg file: $!\n"; } elsif ($movie && -f $movie) { my $last_file = $Registry->{'HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings//File Name 0'}; if (lc($movie) eq lc($last_file)) { open(OUTPUT, '>:raw:encoding(UTF16-LE)', $last_file =~ s/\.\w+$/.reg/r) or die "Cannot create the .reg file: $!\n"; print OUTPUT "\x{FEFF}Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CURRENT_USER\\Software\\Gabest\\Media Player Classic\\Settings]\r\n", '"File Name 0"="', $last_file =~ s/\\/\\\\/gr, "\"\r\n", '"File Position 0"="', $Registry->{'HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings//File Position 0'}, "\"\r\n\r\n"; close(OUTPUT) or die "Cannot close the .reg file: $!\n"; } else { print "The input file does not match the last played one:\n\n$movie\n\n$last_file\n\n"; system('pause'); } } else { my $last_file = $Registry->{'HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings//File Name 0'}; open(OUTPUT, '>:raw:encoding(UTF16-LE)', $last_file =~ s/^.+\\//r =~ s/\.\w+$/+Last_DVD.reg/r) or die "Cannot create the .reg file: $!\n"; print OUTPUT "\x{FEFF}Windows Registry Editor Version 5.00\r\n\r\n[HKEY_CURRENT_USER\\Software\\Gabest\\Media Player Classic\\Settings]\r\n", '"File Name 0"="', $last_file =~ s/\\/\\\\/gr, "\"\r\n", '"File Position 0"="', $Registry->{'HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings//File Position 0'}, "\"\r\n", '"DVD Position 0"="', $Registry->{'HKEY_CURRENT_USER/Software/Gabest/Media Player Classic/Settings//DVD Position 0'}, "\"\r\n\r\n"; close(OUTPUT) or die "Cannot close the .reg file: $!\n"; } ################################################################################
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell\* MPC bookmark] [HKEY_CLASSES_ROOT\*\shell\* MPC bookmark\command] @="C:\\Perl\\bin\\perl.exe E:\\DOC\\prg\\perl\\var\\mpc_bm.pl \"%1\"" [HKEY_CLASSES_ROOT\Folder\shell\* MPC bookmark] [HKEY_CLASSES_ROOT\Folder\shell\* MPC bookmark\command] @="C:\\Perl\\bin\\perl.exe E:\\DOC\\prg\\perl\\var\\mpc_bm.pl \"%1\""
Source: https://habr.com/ru/post/149436/
All Articles