Solved

Possible to run Windows Media Player in command line?

Posted on 2004-10-20
3
205 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
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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