[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Possible to run Windows Media Player in command line?

Posted on 2004-10-20
3
Medium Priority
?
214 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

650 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