Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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

10 Mar 2015   #1
pxfragonard

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 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.


My System SpecsSystem Spec
.
11 Mar 2015   #2
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 System SpecsSystem Spec
11 Mar 2015   #3
pxfragonard

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 
Thank you!

Quote   Quote: Originally Posted by Pyprohly View Post
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 System SpecsSystem Spec
.

12 Mar 2015   #4
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by pxfragonard View Post
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 System SpecsSystem Spec
12 Mar 2015   #5
pxfragonard

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
Quote   Quote: Originally Posted by pxfragonard View Post
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 System SpecsSystem Spec
12 Mar 2015   #6
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

That's right.
My System SpecsSystem Spec
13 Mar 2015   #7
pxfragonard

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Thanks! I may be getting the hang of it... (a wee bit)
My System SpecsSystem Spec
17 Mar 2015   #8
pxfragonard

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

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 System SpecsSystem Spec
18 Mar 2015   #9
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

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 System SpecsSystem Spec
18 Mar 2015   #10
pxfragonard

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
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 System SpecsSystem Spec
Reply

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




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Media Streaming Using Windows Media Player - Turn On or Off
How to Turn On or Off Media Streaming using Windows Media Player in Windows 7 Media streaming (media sharing) allows you to send your music, pictures, and videos to other computers and devices on your same home or work network. If you have a home network, you can use Windows Media Player (WMP)...
Tutorials
Can't turn on captions in Windows Media Player
I am trying to play a DVD on Windows Media Player, and am trying to turn on subtitles. Well, it doesn't give me the option. When I go to captions, it just has "off" selected and no other option (it does not say "on if available" or "on when muted" as I've read it should). It just gives "off" and...
Music, Pictures & Video
iphone 4s turn off auto (?)shuffle
Running the latest ios on a iphone 4s, with the latest itunes installed on pc, my iphone now shuffles every track on any album. The shuffle icon is grey/black and when you press the icon it just shuffles to the next track. this has only happened since latest update. Did a quick google there are...
Software
Can't Turn windows media player back on!?!
About a week ago I went into programs and features clicked turn windows features on and off and disabled all media features rebooted and they were gone. Awsome. Today I deiced to turn them back on but I can't i get an error message saying "An error has occurred. Not all of the features were...
General Discussion
Please help me write a script
Hey all, Long long time lurker, first time poster. I'm leaving the country for vacation and I'd like to setup a script that runs every hour to check and see if my VNC Client is running. I use this VNC client to remote into my computer from my phone and the thought of not being able to do this...
Customization
Windows Media Player - Turn DVD Playback Restrictions On or Off
How to Turn DVD Playback Restrictions On or Off in Windows Media Player This will show you how to set DVD playback restrictions in Windows Media Player to prevent all users (ex: child) with a standard account on your computer from being able to play a DVD movie that is rated higher than the G,...
Tutorials


Our Sites

Site Links

About Us

Find 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 11:45.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App