Re: Login Script - Internet Explorer Patch
From: Torgeir Bakken (MVP) (Torgeir.Bakken-spam_at_hydro.com)
Date: 10/09/03
- Next message: Karl Levinson [x y] mvp: "Re: ** READ THIS BEFORE POSTING - answers to frequently asked questions 2003.10.08"
- Previous message: Karl Levinson [x y] mvp: "Re: ** READ THIS BEFORE POSTING - answers to frequently asked questions 2003.10.08"
- In reply to: Moe Szyslak: "Login Script - Internet Explorer Patch"
- Next in thread: James Whitlow: "Re: Login Script - Internet Explorer Patch"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 09 Oct 2003 13:12:28 +0200
Moe Szyslak wrote:
> How can I determine what version of Internet Explorer is installed via Login
> Script so i can then proceed to install the correct IE Patch?
Hi
Here is a VBScript that installs KB828750 (switches set to suppress reboot), the
script needs to run under an account with administrator rights:
' IE version testing based on registry values listed in
' How to Determine Which Version of Internet Explorer Is Installed
' http://support.microsoft.com/?kbid=164539
' note the sSwitches value for the Win2k3 version!
Set oShell = CreateObject("Wscript.Shell")
' see http://support.microsoft.com/?kbid=828750 for registry values below
sRegValue1 = "HKLM\Software\Microsoft\Active Setup\Installed Components" _
& "\{96543d59-497a-4801-a1f3-5936aacaf7b1}\IsInstalled"
sRegValue2 = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Hotfix" _
& "\KB828750\Installed"
sRegValueData1 = 0 ' init value
sRegValueData2 = 0 ' init value
On Error Resume Next
sRegValueData1 = oShell.RegRead(sRegValue1)
sRegValueData2 = oShell.RegRead(sRegValue2)
On Error Goto 0
' test if the hotfix is already installed or not
If Not(sRegValueData1 = 1 Or sRegValueData2 = 1) Then
' installing the patch
InstallPatch
End If
Sub InstallPatch
sRegPath = "HKLM\SOFTWARE\Microsoft\Internet Explorer\Version"
sIEVer = "" ' init value
On Error Resume Next
sIEVer = oShell.RegRead(sRegPath)
If Err.Number <> 0 Or sIEVer = "" Then
' IE version is 3.0 or less, set it to 0
sIEVer = "0.0.0.0"
End If
On Error Goto 0
aIEVer = Split(sIEVer, ".")
SetLocale "en-us" ' Do not remove
iIEVersion = CDbl(aIEVer(0) & "." & aIEVer(1))
iIEBuildVersion = CDbl(aIEVer(2) & "." & aIEVer(3))
sPatchPath = "" ' init value
sSwitches = " /q /r:n" ' default value
If iIEVersion = 5.0 And _
(iIEBuildVersion = 3502.1000 Or iIEBuildVersion = 3700.1000) Then
' Internet Explorer 5.01 for Windows 2000 SP3 and Windows 2000 SP4
sPatchPath = "\\server\share\q828750\IE501SP3SP4\q828750.exe"
Elseif iIEVersion = 5.5 And iIEBuildVersion = 4807.2300 Then
' Internet Explorer 5.5 SP2
sPatchPath = "\\server\share\q828750\IE55SP2\q828750.exe"
Elseif iIEVersion = 6.0 And iIEBuildVersion = 2600.0000 Then
' Internet Explorer 6 for Windows XP
sPatchPath = "\\server\share\q828750\IE6SP0\q828750.exe"
Elseif iIEVersion = 6.0 And iIEBuildVersion = 2800.1106 Then
' Internet Explorer 6 SP1
sPatchPath = "\\server\share\q828750\IE6SP1\q828750.exe"
Elseif iIEVersion = 6.0 And iIEBuildVersion = 3790.0000 Then
' Internet Explorer for Win2k3
sPatchPath = _
"\\server\share\q828750\IE6Win2k3\windowsserver2003-kb828750-x86-enu.exe"
' not using default switches
sSwitches = " /u /q /z"
Else
MsgBox "You are running a version of Internet Explorer that is " _
& "unsupported by the KB828750 update!", vbCritical, "IE update"
End If
If sPatchPath <> "" Then
' Installing patch
oShell.Run sPatchPath & sSwitches, 1, True
End If
End Sub
-- torgeir Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter
- Next message: Karl Levinson [x y] mvp: "Re: ** READ THIS BEFORE POSTING - answers to frequently asked questions 2003.10.08"
- Previous message: Karl Levinson [x y] mvp: "Re: ** READ THIS BEFORE POSTING - answers to frequently asked questions 2003.10.08"
- In reply to: Moe Szyslak: "Login Script - Internet Explorer Patch"
- Next in thread: James Whitlow: "Re: Login Script - Internet Explorer Patch"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|