jharp80 wrote:
Quote:
> Hi I would like to detect broswer type and version (Example FF2, FF3,
> IE, so on) on the client side using VBScript. 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 ı need to
> query. or is it possible to do this through reading registry keys.
>
> Thanks
I had to grab FireFox versions a little while back myself. THis is the
solution I came up with:
Code:
'=======================================================================
===
'
' NAME: GetFireFoxVersion.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: http://www.thespidersparlor.com
' DATE : 1/27/2009
' COPYRIGHT © 2009, All Rights Reserved
'
' COMMENT:
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE
SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'=======================================================================
===
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
--