4

How to programmatically install Windows Media player using .net.

Windows media player is not a Product, It is Feature of Windows operating system. How to Turn On using .net program if it already off. and also Installing Higher version if necessary (ie., if Windows media player 9 is Exists and Turn On.. It should be Upgraded to Windows media player 11). Can all these done by programmatically.

What are all the ways for doing so.. In Versions of Windows - eg : xp,Vista,Windows 7, etc.

stema
  • 90,351
  • 20
  • 107
  • 135
dinesh
  • 635
  • 1
  • 10
  • 23
  • 2
    This is unwise. There are only two realistic cases where WMP would not be installed. Either because the user uninstalled it explicitly or because local trade rules forbid Microsoft from shipping WMP with Windows (Korea for example). Trying to install WMP yourself is going to produce nothing but misery to the user. You'll need to make it a prerequisite for your program. – Hans Passant Feb 09 '12 at 14:05
  • That is presumputous -- he may be working in a closed environment such as a kiosk where he has explicit control over the machine and it's settings. – erodewald Apr 02 '12 at 13:34

1 Answers1

3

you could execute the DISM utility by Process.Start

this works at least in windows 7, if you open a cmd prompt and run this:

dism /online /enable-feature /featurename:WindowsMediaPlayer

see here for the full article: How to disable / enable Windows 7 features from a command line

Davide Piras
  • 43,984
  • 10
  • 98
  • 147