Usually i find an answer to any mpc questions by searching around awhile, but after hours I'm still stumped if what im trying to do is even possible...
I'm trying to launch mpc-hc from a command line and have it automatically resume playback of the most recent file.
Is that possible? So far, launching it is easy from a command prompt. However, after that, I must physically click the "play" button for it to resume playback of the last file that was played. Is there a way I can trigger this from the command prompt as well?
Here's hoping...
+ Reply to Thread
Results 1 to 8 of 8
-
-
The "/startpos 0:0:0" switch works to resume playing when you supply a filename on the command line.
Code:mpc-hc64 /startpos 0:0:0 filename.mp4
Code:for /f "tokens=2,*" %%a in ('reg query "HKEY_CURRENT_USER\Software\MPC-HC\MPC-HC\Recent File List" /v "File1" ^| findstr "File1"') do ( set LAST_NAME=%%b ) "G:\program files\MPC HomeCinema (x64)\mpc-hc64" /startpos 0:0:0 "%LAST_NAME%"
-
THANK YOU! You are amazing, wonderful, a God sent even. Been trying to find a way for ages, and I knew it most likely had to do with understanding registry tokens or what not but there was no way I was going to learn how to do that anytime soon. What you told me works perfectly. Thanks a ton!
-
May I ask one more follow up if you don't mind? What's the command I can add at the end of the batch file that will close the msdos window?
Nevermind. After a bit more research, I found the solution was to add '| taskkill /F /IM cmd.exe' at the end. All is perfect now. Thanks again.Last edited by Spixe; 12th Jul 2017 at 11:03. Reason: found answer.
-
I had to do a little research too. After figuring out MPCHC wouldn't automatically continue without supply a filename I search through the Registry for MPCHC's recent file list. Then I searched for methods of getting Registry keys in a batch file. Finally, I simplified the examples I found.
To automatically close the CLI window change the second line to:
Code:Start /b "Window Title" "G:\program files\MPC HomeCinema (x64)\mpc-hc64" /startpos 0:0:0 "%LAST_NAME%"
Last edited by jagabo; 12th Jul 2017 at 11:13.
-
Interesting. During my research, or also just in what I've come up with in the past, I knew I could use "start /b" to close the window when finished - but in this case, I couldn't get "start" to work for me. Usually it's a simple as putting the exe outside the quotes (with the quotes just pertaining to the directory), but it wouldn't take this time. Funny how what it took was a "Window Title" for that to work... I've no idea why that is, but I'm not certainly not complaining. I reckon it's safer than using taskkill too. Thanks for the lesson in batch files.
-
The first argument after Start is normally the name of the new window. Even when using the /b switch it seems to like having the window name. Without it I think Start was using the "\path\to\mpchc" as the window name and assuming /startpos was another argument to Start, not an argument to be passed to MPCHC. It took me a while to figure that out too. Of course, you can use any text you want, not just "Window Title".
-
Ha, funny, because I did actually just try inserting "" after /start, just as an experiment. Turns out all I had to do was ad ANYTHING between there. Nevertheless, I couldn't have got it working without ya, so again, much obliged. Wish I could give you a "rep" +1 or something.
Similar Threads
-
MPC-HC Juddery Playback
By VideoFanatic in forum Software PlayingReplies: 7Last Post: 28th Dec 2018, 07:42 -
Complex batch file using multiple DOS Utilities
By Budman1 in forum User guidesReplies: 7Last Post: 27th Dec 2016, 09:42 -
Problem with DOS command
By Jamaika in forum ProgrammingReplies: 7Last Post: 12th May 2015, 10:50 -
DOS batch command variable
By sambat in forum ProgrammingReplies: 6Last Post: 24th Sep 2014, 13:14 -
can copy file from ftp in dos-prompt?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 19th May 2014, 04:50