Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

WMP with command line

hi,

i'm trying to launch windows media player (10) with a command line.
the result is always "the system cannot find the file specified.
the code:

try
                  {
                        string strCmdLine = "C:\\Program Files\\Windows Media Player\\wmplayer.exe /play /fullscreen c:\\Castaway.mp3";
                        Process.Start(strCmdLine);
                  }
                  catch(Exception ex)
                  {
                        MessageBox.Show(ex.Message);
                  }

i double checked and the file is there, what's wrong?
0
Meir Rivkin
Asked:
Meir Rivkin
1 Solution
 
AlexFMCommented:
Try this:


string s1 = "C:\\Program Files\\Windows Media Player\\wmplayer.exe";
string s2 = "/play /fullscreen c:\\Castaway.mp3";

Process.Start(s1, s2);
0
 
Meir RivkinFull stack Software EngineerAuthor Commented:
cheers
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now