Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - newbie Help: HOW to use VBSCript on clientside to detect browser typeand version

Reply
 
Old 07-01-2009   #11 (permalink)
Mark D. MacLachlan


 
 

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

Bob Barrows wrote:
Quote:

> jharp80 wrote:
Quote:

> > On Jun 15, 7:09 am, "Bob Barrows" <reb01...@xxxxxx> wrote:
Quote:

> >> jharp80 wrote:
> >>> 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
> >> will need to use javascript instead.
> > >
> >>> 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.
Quote:
Quote:

> > >
> >> No registry keys are needed. DHTM should suffice.
> >> See:http://www.dynamicdrive.com/dynamici...sersniffer.htm
> > >
> >
> > Thanks for your reply. I am interested in detecting only Firefox and
> > IE versions installed.
>
> Installed? That's a different question. That answer would require a
> search of the registry.
>
Quote:

> > 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.
>
> An HTA page runs in a browser doesn't it? It just uses a different
> library to process the html.
>
Quote:

> > There must be a way to detect firefox as well, the script you
> > mentioned seems to support detection of several broswers but Firefox
>
> I found that page via a google search that had many more hits, many of
> which will contain the details for firefox:
> http://lmgtfy.com/?q=javascript+browser+detection
Actually an HTA does not run in a browser, it runs in the process
MSHTA.EXE. It is independent of IE or FireFox.

Regards,

Mark D. MacLachlan

--


My System SpecsSystem Spec
Old 07-01-2009   #12 (permalink)
Bob Barrows


 
 

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

Mark D. MacLachlan wrote:
Quote:

> Bob Barrows wrote:
Quote:

>> An HTA page runs in a browser doesn't it? It just uses a different
>> library to process the html.
>>
> Actually an HTA does not run in a browser, it runs in the process
> MSHTA.EXE. It is independent of IE or FireFox.
>
I stand corrected. Thanks

--
Bob Barrows


My System SpecsSystem Spec
Old 07-01-2009   #13 (permalink)
mayayana


 
 

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

Quote:

> Actually an HTA does not run in a browser, it runs in the process
> MSHTA.EXE. It is independent of IE or FireFox.
>
For all practical purposes it is IE, with a handful of
minor differences connected with MSHTA.exe, and an
extra <HTA tag that mshta processes.
If you look at the window hierarchy you'll see that
under the mshta window is a window of class
Internet Explorer_Server. That's an IE browser window.
It's the window class that an IE webpage runs in,
whether it's IE, a WebBrowser control, an HTA, or even
a pre-XP Active Desktop folder window. They're all
basically IE. The difference is only in the "chrome" or
parent window frame.


My System SpecsSystem Spec
Old 07-01-2009   #14 (permalink)
mayayana


 
 

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

That method seems a bit iffy.
You're assuming that FF is in Program Files and
that the folder is the default. I happen to use simply
"Firefox" as the parent folder, which is an easy
choice to make during install. Likewise, someone
might easily not install to P.F. In fact, avoiding the
PF folder has been a favorite trick of people struggling
with UAC under Vista.
Quote:

> Dim objFSO
> strComputer = "."
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
>
> If objFSO.FileExists("C:\Program Files (x86)\Mozilla
> Firefox\FireFox.exe") Then
> FF = "C:\\Program Files (x86)\\Mozilla Firefox\\FireFox.exe"
> ElseIf objFSO.FileExists("C:\Program Files\Mozilla
> Firefox\FireFox.exe") Then
> FF = "C:\\Program Files\\Mozilla Firefox\\FireFox.exe"
> Else
> FF = "NotFound" 'FireFox not found
> End If
>
> If FF <> "NotFound" Then
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer &
> "\root\cimv2")
> Set colFiles = objWMIService.ExecQuery _
> ("Select * from CIM_Datafile Where name = '" & FF &"'")
> For Each objFile in colFiles
> Wscript.Echo "FireFox Version: " & objFile.Version
> Next
> End If
> [/code]
>
> --
>

My System SpecsSystem Spec
Old 07-02-2009   #15 (permalink)
mayayana


 
 

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

>>' NAME: GetFireFoxVersion.vbs
Quote:
Quote:

>>'
>>' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
>>' URL: http://www.thespidersparlor.com
>>' DATE : 1/27/2009
>>' COPYRIGHT © 2009, All Rights Reserved
>>'
Quote:
Quote:

> > If FF <> "NotFound" Then
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & strComputer &
> > "\root\cimv2")
> > Set colFiles = objWMIService.ExecQuery _
> > ("Select * from CIM_Datafile Where name = '" & FF &"'")
> > For Each objFile in colFiles
> > Wscript.Echo "FireFox Version: " & objFile.Version
> > Next
Also note, if you had read the rest of the
thread you'd know that there's another glitch
with this method. Using a simplified version
of your script:

Set objFile = GetObject("winmgmts:CIM_Datafile.Name='C:\program
files\firefox\firefox.exe'")
MsgBox objFile.Version

I have FF 1.5 installed. It returns v. 1.8. That's
because the FF file version is actually the gecko
version. The real file version is the product version.
There's a cross-reference chart here:

http://en.wikipedia.org/wiki/Gecko_(layout_engine)

One has to wonder why you took the trouble
to post such an off-the-cuff response to a thread
that's been closed for two weeks, and without even
reading the oher posts, unless it's just to spam the
group with your ad for a $150 package of scripts.

Incidentally, I'm not claiming any copyright on
my two lines of script posted above. You can have
them both for a one-time-only-special-price of *free*.


My System SpecsSystem Spec
Old 07-02-2009   #16 (permalink)
Mark D. MacLachlan


 
 

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

Mayayana, I didn't realize it was considered bad form to try to provide
additional methods to a problem. I've just started using these forums
at the recommendation of a coworker. I've provided free technical
support on the Tek-Tips web site for years, having posted over 10K
replies and been an MVP on that site for many years.

I guess the biggest difference between the sites is that Tek-Tips
management has a no flame policy. Your post is an unprovoked personal
attack.

Why you should care that I add copyright and disclaimer information to
a script I have given for free is beyond my comprehension. I believe
credit should be given where due as evidenced in my login script FAQ
http://www.tek-tips.com/faqs.cfm?fid=5798 where I site others who
contributed some functions.

For the record I did read the entire threads and believed that
information provided for IE was sufficient but I felt I could
contribute to the discussion on FireFox.

Good day to you.

Mark
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Is Vbscript can support with many browser...? VB Script
Detect which version of Visual Studio compiled a program .NET General
browser version Browsers & Mail
How to detect .NET Framework version of an Assembly .NET General
Newbie Vista Version Question Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46