Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net Command for Opening a file with default windows media player 1

Status
Not open for further replies.

rkuhn68

Programmer
Jul 16, 2003
3
US
Here is the situation...

I have stored a AVI / MPG File Name in a SQL Column... Upon retrieval of the File name from the database and subsequent storage of the path and File into a String Variable, I would like to open the file in the media player that has been set as the default for the PC running the VB.NET windows application.

What would be the VB.NET Code to open the file in the default media player? In effect the same thing that happens when you double click the file in an explorer window...

I think I could open the file with a shell command supplying windows media player as the chosen application, but this would limit my options to windows media player and require the exact location of the media player application...

Any Help is Greatly Appreciated... Thanks!!!


 
Try using:

System.Diagnostics.Process.Start(strFullFilePath)

This will launch the specified file in it's associated application, and should work for most file types. You can also launch IE using a URL in place of the file path.

Note that although this will launch Media Player, the user may still have to manually start the clip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top