auto shutdown after playing an mp3 list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wrote a batch file first to invoke windows media player with an mp3 list
and then invoked shutdown command. It doesn't work.

Any tools/command line utilities or tips and tricks appreciated.
 
The Media Player has a host of functions available to run music files, and
others, even closing the player when done, but they are not accessible from
a batch file. You could start an app like wmp, and wait till it closes, but
it would have to close, which wmp does not do after playing a file.
Scripting would create a player object, and could use events from it to
close itself, then do the shutdown.
 
---playNshutdown.vbs--cut--
set shell=createobject("wscript.shell")
set wmp=createobject("WMPlayer.OCX.7")
wmp.currentPlaylist = wmp.mediaCollection.getByName("New Playlist")
wmp.controls.play()
while(9 > wmp.playState or wmp.playState > 7)
wscript.sleep 2000
wend
shell.run "shutdown -f -s -t 0"
wscript.quit
--cut here--
 
code error in that last
should be
-------
set shell=createobject("wscript.shell")
set wmp=createobject("WMPlayer.OCX.7")
wmp.currentPlaylist = wmp.mediaCollection.getByName("New Playlist")
wmp.controls.play()
while (10 <> wmp.playState)
wscript.sleep 2000
wend
shell.run "shutdown -f -s -t 00"
wscript.quit
-------
 
Back
Top