Solved

Possible to run Windows Media Player in command line?

Posted on 2004-10-20
3
209 Views
Last Modified: 2008-01-09
I'm going to write a program that is to press a 'start' button and then open the Windows Media Player with a specific video/audio file.  I'm not sure if Windows Media Player can accept parameter that is to execute the Player with the video/audio file?
0
Comment
Question by:kwkaan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12367060
You can do that, this will open Media Player and play the file Logo1.avi

        Shell("C:\Program Files\Windows Media Player\mplayer2.exe C:\Logo1.avi", AppWinStyle.NormalFocus)

Argument after a space
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12367416
This is the .net way

        System.Diagnostics.Process.Start("C:\Program Files\Windows Media Player\mplayer2.exe","c:\logo1.avi")

if you want to run the media player inside your program look at this article

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/playingdigitalmediainavisualbasicnetapplication.asp
0
 
LVL 6

Accepted Solution

by:
The_Biochemist earned 500 total points
ID: 12389220
Inside your application you can simply add a reference to the WMPLib.dll COM component

then using it is as simple as :

1)        Imports WMPLib

2)        Dim WMP as new WindowsMediaPlayer

3)        With WMP
            .URL = "C:\Logo1.avi"
            .controls.play()
           End With

OR

You can add the WMPLib.dll to your Toolbox and then drag it onto the form and have a nice Media player 9 window on your form directly rename it to WMP and then use the code in (3) above to play it.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question