Sign in to follow this  
Followers 0
DoctorWho

Determining Internet Explorer Version

10 posts in this topic

#1 ·  Posted (edited)

Good day

I need a bit of help.

I need a way to determine the version of Internet Explorer that is installed on an end users PC. I don't need any indepth information, I just need to know if it is IE 6, 7 or 8 and the soon to be version 9.

If there is a way to tell if Internet Explorer is the default browser that would be nice too but I think that would be asking a bit too much.. :(

This is the last piece to a larger script I've been working on and any assistance would be greatly appreciated.

Thanks..

Edited by DoctorWho

Share this post


Link to post
Share on other sites



Good day

I need a bit of help, I've been searching the help file & forum but have not found a solution.

I need a way to determine the version of Internet Explorer that is installed on an end users PC. I don't need any indepth information, I just need to know if it is IE 6, 7 or 8 and the soon to be version 9.

If there is a way to tell if Internet Explorer is the default browser that would be nice too but I think that would be asking a bit too much.. :(

This is the last piece to a larger script I've been working on and any assistance would be greatly appreciated.

Thanks..

Just disregard this, I can't believe I actually went blank when I posted this and then the answer hit me on how to determine the file version - brain fart.. Sorry..

Now, if anyone knows how to tell if Internet Explorer is set as the default browser or not, that would be great.

Thanks..

Share this post


Link to post
Share on other sites

You can read it from the registry. I think the two keys to check are

HKCU\Software\Clients\StartMenuInternet

The above key changes only for the current user profile. If you want to make changes to the system, delete the above key and set your default browser entry here:

HKLM\Software\Clients\StartMenuInternet


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

You can read it from the registry. I think the two keys to check are

Thank you very much, that is exactly what I needed.. :(

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This may help..

Func _IEGet()
    Local $sVersion = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
    Switch StringLeft($sVersion, 1)
        Case "8"
            Return "8"
        Case "7"
            Return "7"
        Case "6"
            Return "6"
        Case "5"
            Return "5"
        Case "4"
            Return "4"
        Case "3"
            Return "3"
        Case "2"
            Return "2"
        Case Else
            Return "0"
    EndSwitch
EndFunc ;==>_IEGet
Edited by PeterAtkin

[topic='115020'] AD Domain Logon Script[/topic]

Share this post


Link to post
Share on other sites

Hi DoctorWho,

What code did you use to check what version of IE is installed on the PC?

Share this post


Link to post
Share on other sites

Hi DoctorWho,

What code did you use to check what version of IE is installed on the PC?

Try this Varian script

ConsoleWrite ( "_GetIEVersion : " & _GetIEVersion() & @Crlf )

Func _GetIEVersion()
    Select
        Case FileExists(@ProgramFilesDir & '\Internet Explorer\iexplore.exe')
            $iE_Version = FileGetVersion(@ProgramFilesDir & '\Internet Explorer\iexplore.exe')
        Case @OSArch = 'X64'
            If FileExists(StringRegExpReplace(@ProgramFilesDir, '(?i) \(x86\)', '') & '\Internet Explorer\iexplore.exe') Then $iE_Version = FileGetVersion(StringRegExpReplace(@ProgramFilesDir, '(?i) \(x86\)', '') & '\Internet Explorer\iexplore.exe')
        Case Else
            Return 4
    EndSelect
    Switch Int($iE_Version)
        Case 0 To 4
            Return 4
        Case 5
            Return 2 + 4
        Case Else
            Return 1 + 2 + 4
    EndSwitch
EndFunc   ;==>_GetIEVersion ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Thanks for the reply DoctorWho. I went with a rather simpler approach though. Here's the code i used.

$IEversion = RegRead ("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version")

$IEversionInteger = Int($IEVersion)

Once i turned the IEVersion value into an integer, it dropped the change (the .0.2.2.4) which is what i wanted. I'm using the code as a check in preperation for upgrading XP machines running IE6 to IE7.

Share this post


Link to post
Share on other sites

You only need a single line of code

$sIEversion = StringRegExpReplace(RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version"), "^(\d+)\..+$", "$1")

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

I like the belt and braces approach, you never know what MS will do next....

Func _IEGet()
    Local $sVersion = StringRegExpReplace(RegRead("HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer", "Version"), "^(\d+)\..+$", "$1")
    If @error <> 0 Then
        $sVersion = FileGetVersion(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")
        ConsoleWrite(@CRLF & ">>>> IE Version is: " & $sVersion & " " & " <<<< error:" & @error & @CRLF & @CRLF)
        ConsoleWrite("Possible Regisitry / IE issue?" & @CRLF)
    Else
        ConsoleWrite(@CRLF & ">>>> IE Version is: " & $sVersion & " " & " <<<<" & @CRLF & @CRLF)
    EndIf
    Return $sVersion
EndFunc ;==>_IEGet

[topic='115020'] AD Domain Logon Script[/topic]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0