View Single Post
Old 06-15-2009   #4 (permalink)
mayayana


 
 

Re: newbie Help: HOW to use VBSCript on clientside to detect browser type and version

When you say "client-side" that implies you're
talking about doing it through a visited webpage.
If it's an HTA with VBScript then you must mean
that you're running your HTA on a local PC. (You
can't do anything like what you're asking over the
Internet.)

For IE, a couple of tests that might be good:

1) The default value in this key should give you the
path to IE. You can then check the version of the file:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App
Paths\IEXPLORE.EXE

2) This value provides the IE version:

HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer

The latter method may be less trustworthy. On my own
system, for instance, I installed an HP printer that
insisted I didn't have a recent enough version of IE. (!)
I had to change that Registry value to a higher
number in order to stop the HP installer malfunction.
I've found a number of similar cases, where software
installers check the IE version for no good reason.
So I set that Registry value high and recommend the
same to others.

-----------

Firefox is awkward because it doesn't register
its executable in the App Paths Registry key.
On my system it's accessible in two ways:

1)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Mozil
la Firefox (1.5)\DisplayVersion

I have v. 1.5 installed. Clearly this method requires some
parsing, though. It doesn't look like a very dependable
approach. You'd have to enumerate the Uninstall keys
(probably with WMI) and check for one with "firefox"
in the name. However the InstallLocation value should
give you the FF program folder, where you could check the
file version. But that then involves another problem:
Firefox.exe has a file version that's actually the gecko
version! What you need is the "product version". For that,
see here for a VBS class that extracts the version info.
data from a file's resource table:

www.jsware.net/jsware/scripts.php5#fvinfo

2) This method might be easier, but I don't know whether
it's standardized across FF versions. On my system, at least,
there's a value:
HKEY_LOCAL_MACHINE\Software\Mozilla\Mozilla Firefox\CurrentVersion

The value there is "1.5(en-US)". So again, you'd
have to parse the value.

Whatever method you end up with, if I were you
I'd check it across versions before depending on the
script. You can't depend on standardization. And you
can't depend on program path.

Quote:
Quote:

> > Hi I would like to detect broswer type and version (Example FF2, FF3,
> > IE, so on) on the client side using VBScript.
>
> You will not be able to use vbscript with Firefox - it is not supported.
You
Quote:

> will need to use javascript instead.
>
Quote:

> > I appreciate any script
> > on this I can do; and if not available some general guidelines how I
> > should accomplish this using VBSCript ;example what objects i need to
> > query. or is it possible to do this through reading registry keys.
>
> No registry keys are needed. DHTM should suffice.
See:http://www.dynamicdrive.com/dynamici...sersniffer.htm
Quote:

>
> --
> Microsoft MVP - ASP/ASP.NET - 2004-2007
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
Thanks for your reply. I am interested in detecting only Firefox and
IE versions installed. And I like to do so without the browesers
actually launched.

I have an hta script; so the code that I am looking for to do the
detection will be included in that hta script written in VBScript.
There must be a way to detect firefox as well, the script you
mentioned seems to support detection of several broswers but Firefox
which is what I need along with IE. any other thoughts? Thanks.


My System SpecsSystem Spec