I could query the executable directly but would prefer not to as some of the
versions are very old so some will be Mplayer.exe, Mplayer2.exe, WMPlayer.exe
etc...
Does anyone know of a class I can use to query info about media player?
Thanks
Steve
There is no neat-and-clean way to get this (that I know of).
Here is one suggestion.
As long as the windows media player is installed in the
customary place, (Program Files\Windows Media Player),
then you can "walk" the list of files in there using fso,
to pick out the possibilities (you mentioned: Mplayer.exe,
Mplayer2.exe, WMPlayer.exe, etc). Note that there could
be more than one, as subsequent version may have been
installed without un-installing the previous version.
Next you determine the version of each of the possibilities
(the "sticky-wicket" part).
The most "pure script" approach for getting the version
would be to use wmi's win32_FileSpecification class, which
can get you the version property of a file (as a string).
See here:
There is a demo script, showing how to use
win32_FileSpecification here (search down to the middle
of the page):
http://www.activexperts.com/activmonitor/windowsmanagement/wmi/samples/apps/#Win32_FileSpecification.htm
The other approach is to use the system api's (because
wmi does not always work as advertised). Using api's in
script is problematical, especially in this case because
typedefs are involved. So you best bet is to write an actX
"wrapper" for the api call.
Just in case you are considering using api's, sample code
may be found here:
http://www.vb-helper.com/howto_file_version_info.html
After you have determined the latest version of wmplayer(s),
one may fairly assume that is the one the user is using.
cheers, jw
____________________________________________________________
You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)
However, you can get it using "fso.GetFileVersion(path)".
So, no excursions into wmi, or api calls are necessary.
Plain ole fso will do it.
cheers, jw
I better get writing that script hadn't I :)
Thanks again
Steve