Play Windows Media Player song or playlist


posted by Tobias Weltner
01-09-2009

Downloads: 387
File size: 335 B
Views: 3,244

Embed
Play Windows Media Player song or playlist
  1. $name = read-host "Enter media name/song name/playlist name"   
  2. $player = new-object -com WMPLAYER.OCX   
  3. $item = $player.mediacollection.getByName($name)   
  4. if ($item.Count -gt 0) {   
  5.     $filename = $item.item(0).sourceurl   
  6.     "Playing $filename"   
  7.     $player.openplayer($filename)   
  8. } else {   
  9.     "'$name' not found."   

Asks for a song name or playlist name and then asks Windows Media Player to play this for you. Excellent way to start your day with the right mood and song when added to your PS profile...

Comments

Karl Snooks wrote re: Play Windows Media Player song or playlist
on 01-26-2009 12:58 PM

Tobias,

You might want to "test-drive" this script.

Karl

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.