MPC script for resuming playback

2 posters

Go down

MPC script for resuming playback Empty MPC script for resuming playback

Post by 1111Eugene Wed Jun 01, 2022 9:24 am

Hi, I want to make a script that loads mpc and the most recent file and resumes the playback. There was an old script on the videohelp forum but it doesn't work anymore. So I need a new one. And... I use powershell for this. And I don't really get what do I do wrong with the pathname parameter.
I get the most recent filename from the registry. And the problem is when I run for example

Start "c:\Program Files (x86)\K-Lite Codec Pack\MPC-HC64\mpc-hc64.exe" "E:\My Downloads\[04-2022] react-redux\05 State in React Components\056 Updating State Properties.mp4"

the player opens and says that file not found.
Why? What's wrong? Why it doesn't like the pathname?
Thank you

1111Eugene

Posts : 4
Join date : 2022-06-01

Back to top Go down

MPC script for resuming playback Empty Re: MPC script for resuming playback

Post by 1111Eugene Wed Jun 01, 2022 10:29 am

ok I've managed to do this. Need to finish it and will post it here if somebody needs it

1111Eugene

Posts : 4
Join date : 2022-06-01

Back to top Go down

MPC script for resuming playback Empty Re: MPC script for resuming playback

Post by 1111Eugene Wed Jun 01, 2022 4:01 pm

here's the script

Code:
$folders = Get-ChildItem -Path HKCU:\Software\MPC-HC\MPC-HC\MediaHistory\
$filename = $folders[0].GetValue("Filename")
cmd.exe /c Start "c:\Program Files (x86)\K-Lite Codec Pack\MPC-HC64\mpc-hc64.exe" $filename

save as a yourfilename.ps1

make a shortcut on your desktop and insert in the input
yourPathToPowershell.exe -File "pathtoyourfilename.ps1"
mine for example looks like this
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -File "d:\My Downloads\Soft\continue.ps1"

the only problem is that it shows a powershell terminal window and there's no way to fix it (without 3rd party scripts or apps, so please google one for yourself if needed)

1111Eugene

Posts : 4
Join date : 2022-06-01

Back to top Go down

MPC script for resuming playback Empty Re: MPC script for resuming playback

Post by Admin Wed Jun 01, 2022 5:41 pm

The player already has options to remember file history and playback position. All you need to do is start the player and press play.

Plus the script is wrong, as first subkey isn't necessarily the last opened item.

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

MPC script for resuming playback Empty Re: MPC script for resuming playback

Post by 1111Eugene Wed Jun 01, 2022 6:16 pm

Admin wrote:The player already has options to remember file history and playback position. All you need to do is start the player and press play.

Plus the script is wrong, as first subkey isn't necessarily the last opened item.

oh yeah? what if I don't wanna press play?
How is it wrong? make the player run and play right away with your correct script then and show it to us.

1111Eugene

Posts : 4
Join date : 2022-06-01

Back to top Go down

MPC script for resuming playback Empty Re: MPC script for resuming playback

Post by Admin Wed Jun 01, 2022 11:54 pm

In next version /play will be enough to resume last file.

Admin
Admin

Posts : 7632
Join date : 2011-06-17

https://codecs.forumotion.net

Back to top Go down

MPC script for resuming playback Empty Re: MPC script for resuming playback

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum