I'd like to write a script to turn off shuffle in Windows Media Player

Page 1 of 2 12 LastLast

  1. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #1

    I'd like to write a script to turn off shuffle in Windows Media Player


    Could someone show me how to do that, please?

    Sorry. I have Task Manager open WMP at a particular time to wake from hibernation. Then there's a scheduled task to play a wakeup playlist.

    So I actually want a script or .bat file to open WMP and turn off shuffle so the playlist plays in the proper order.
    Last edited by pxfragonard; 10 Mar 2015 at 08:17. Reason: clarity
      My Computer


  2. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #2

    Here's a command that will turn shuffle off in Windows Media Player. Run this before starting your playlist.
    Code:
    reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeShuffle" /t REG_DWORD /d 0 /f
      My Computer


  3. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #3

    Thank you!


    Pyprohly said:
    Here's a command that will turn shuffle off in Windows Media Player. Run this before starting your playlist.
    Code:
    reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeShuffle" /t REG_DWORD /d 0 /f
    Thanks very much. I've pasted that into Notepad and saved it as a .bat file. If I program my task scheduler to run that before the playlist is scheduled, that ought to work, eh? Then I can just manually turn shuffle on when I want it. That's just great. Appreciate it!
      My Computer


  4. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #4

    pxfragonard said:
    If I program my task scheduler to run that before the playlist is scheduled, that ought to work, eh?
    Yes.

    Glad you found what you're looking for. Remember to mark the answered thread as Solved.

    Also, you do not need to wrap the command into a batch file. Let Task Scheduler run the command directly.
      My Computer


  5. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #5

    Pyprohly said:
    pxfragonard said:
    If I program my task scheduler to run that before the playlist is scheduled, that ought to work, eh?
    Yes.

    Glad you found what you're looking for. Remember to mark the answered thread as Solved.

    Also, you do not need to wrap the command into a batch file. Let Task Scheduler run the command directly.
    Thanks. Just wondering if turning shuffle back on would be written:

    reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeShuffle" /t REG_DWORD /d 1 /f

    Is that right?
      My Computer


  6. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #6

    That's right.
      My Computer


  7. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #7

    Thanks! I may be getting the hang of it... (a wee bit)
      My Computer


  8. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #8

    Hmm. I find it doesn't work and know why. I fall asleep (and the computer is set to hibernate) looking at photographs and listening to music. So, when the computer wakes up to wake me up, WMC is still running and so the command to turn shuffle off doesn't work. I've tried running the command with WMP on and it doesn't work so I assume it's the same when WMC is on since they share. Running the playlists in WMC won't help. I guess I need to find a way to turn WMC off before hibernation.
      My Computer


  9. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #9

    The 'turn off shuffle' command, as you found, does not affect an existing Windows Media Player process. After applying the command, you are to start a new instance of WMP.

    And afaik, because only one instance of WMPlayer.exe is permitted at a time, my only suggestion for you is to kill and restart WMP, and perhaps WMC too. I noticed you've already caught on to this idea and you have recently started a thread where you ask for a command that closes the WMC window (I assume this thread and that thread relate).

    Killing WMC/WMP, running the 'turn off shuffle' command, then invoking your playlist seems like the only option. To assure this happens in linear sequence, a batch script may be needed.


    The command to kill Windows Media Centre:
    Code:
    taskkill /im ehshell.exe
    The command to kill Windows Media Player:
    Code:
    taskkill /im WMPlayer.exe
      My Computer


  10. Posts : 339
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #10

    Pyprohly said:
    The 'turn off shuffle' command, as you found, does not affect an existing Windows Media Player process. After applying the command, you are to start a new instance of WMP.

    And afaik, because only one instance of WMPlayer.exe is permitted at a time, my only suggestion for you is to kill and restart WMP, and perhaps WMC too. I noticed you've already caught on to this idea and you have recently started a thread where you ask for a command that closes the WMC window (I assume this thread and that thread relate).

    Killing WMC/WMP, running the 'turn off shuffle' command, then invoking your playlist seems like the only option. To assure this happens in linear sequence, a batch script may be needed.


    The command to kill Windows Media Centre:
    Code:
    taskkill /im ehshell.exe
    The command to kill Windows Media Player:
    Code:
    taskkill /im WMPlayer.exe
    Thanks. Yes, I tried taskkill /f /im ehshell.exe to kill WMC and noticed it also closes WMP in task manager within a few seconds, probably because WMC is dependent on WMP. I could program a timer to run taskkill /f /im ehshell.exe just before hibernation so that WMP would play my playlist in order on waking but then I wondered what would happen if, for some reason, WMC isn't running at the time. I don't suppose it would it have any ill effect if it weren't running but I like to check these things first. And I don't understand the "if" part of the language.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:35.
Find Us