Re: Login Script - Internet Explorer Patch

From: Torgeir Bakken (MVP) (Torgeir.Bakken-spam_at_hydro.com)
Date: 10/09/03


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


Relevant Pages

  • Re: MSN Groups and page cannot be displayed
    ... found in the previous patch) they will pre-empt the availability/ ... I had such an instance myself where an update I had prior to an IE6 ... Active Scripting *must* be enabled for this to work. ... > I tried installing the patch for IE6 which claims to fix this problem but ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Push SASSER patch to 85 workstations?
    ... What I really need is to get around the 'admin' ... permissions issue on installing the patch. ... >torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.win2000.general)
  • Re: [Error number: 0x8DDD0004]
    ... ,and I got access to windows update site. ... After installing this update and on reboot.The system asked for password and ... clearing your Internet Explorer Temporary ... > torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.windowsupdate)
  • Re: MS.Blast virus and auto update
    ... It seems like I've been installing the same three updates ... >Update web site while using Internet Explorer. ... >Blaster Worm: Critical Security Patch for Windows XP ...
    (microsoft.public.windowsxp.security_admin)
  • Re: is it necessary to install MS03-039 if MS03-026 is already installed?
    ... Do we need to do that first prior to installing MS03-039? ... because the new patch is updating the same files that the old one ... Microsoft MVP Scripting and WMI, ...
    (microsoft.public.security)