Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with Office SPs and Hotfixes

93 views
Skip to first unread message

news.microsoft.com

unread,
Nov 18, 2003, 9:06:56 PM11/18/03
to
How would I determine hotfix levels for say word, outlook, etc? I am
attempting to verify each machine is properly patched. I have checked
everything except for office. Any help is greatly appreciated.


Torgeir Bakken (MVP)

unread,
Nov 18, 2003, 10:17:49 PM11/18/03
to
"news.microsoft.com" wrote:

Hi

Office versions and updates is pretty complicated to check for (see below for
an example on a Word check). I suggest that you look into e.g. MBSA

From Microsoft Office Security Bulletin Summary for November, 2003
http://www.microsoft.com/technet/security/bulletin/offnov03.asp

<quote>
Microsoft Baseline Security Analyzer (MBSA):

The Microsoft Baseline Security Analyzer allows administrators to scan local
and remote systems for missing security patches as well as common security
misconfigurations. More information on MBSA is available at:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/tools/mbsahome.asp

</quote>

But if you want to look into itself, here is some info/code (not extensively
tested!) for a quick Word version/patch test.

The following test is done:

If OFF2000 is installed, check if SP3 is installed. If it is, check if MS03-050
is installed.
If OFF2002 is installed, check if SP2 is installed. If it is, check if MS03-050
is installed.

The checks are done based on the file version of winword.exe, found at the
following documents:

OFF2000 SP3 http://support.microsoft.com/?kbid=326585
Microsoft Word Winword.exe 9.0.0.6926

OFF2002 SP2 http://support.microsoft.com/?kbid=325671
Microsoft Word Winword.exe 10.0.4219.0

Microsoft Security Bulletin MS03-050
Vulnerability in Microsoft Word and Microsoft Excel Could Allow
Arbitrary Code to Run
http://www.microsoft.com/technet/security/bulletin/MS03-050.asp

Winword.exe OFF2000: 9.0.0.8216
Winword.exe OFF2002: 10.0.5815.0


Here goes:

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

sRegValue = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
& "\App Paths\Winword.exe\"

' exe path is in the default value
sAppExe = RegRead(sRegValue)

If sAppExe = "" Then
WScript.Echo "Word is not installed"
Else
sVer = oFSO.GetFileVersion(sAppExe)
WScript.Echo sVer
aVer = Split(sVer, ".")
If Fix(aVer(0)) = 9 Then
WScript.Echo "Word version is 2000"

sVerSP3 = "9.0.0.6926"
sResult = CompareFileVersions(sVerSP3, sVer)

If sResult = "FirstFileNewest" Then
WScript.Echo "SP3 for Office 2000 is not installed, please install it"
Else
sVerMS03_050 = "9.0.0.8216"
sResult = CompareFileVersions(sVerMS03_050, sVer)
If sResult = "FirstFileNewest" Then
WScript.Echo "MS03-050 is not installed, please install it"
End If
End If

Elseif Fix(aVer(0)) = 10 Then
WScript.Echo "Word version is 2002"

sVerSP2 = "10.0.4219.0"
sResult = CompareFileVersions(sVerSP2, sVer)

If sResult = "FirstFileNewest" Then
WScript.Echo "SP2 for Office 2002 is not installed, please install it"
Else
sVerMS03_050 = "10.0.5815.0"
sResult = CompareFileVersions(sVerMS03_050, sVer)
If sResult = "FirstFileNewest" Then
WScript.Echo "MS03-050 is not installed, please install it"
End If
End If
Else
WScript.Echo "Word version is lower than 2000, please upgrade"
End If
End If


Function RegRead(sRegValue)
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
RegRead = oShell.RegRead(sRegValue)
' If the value does not exist, error is raised
If Err Then
RegRead = ""
Err.clear
End If
' If a value is present but uninitialized the RegRead method
' returns the input value in Win2k.
If VarType(RegRead) < vbArray Then
If RegRead = sRegValue Then
RegRead = ""
End If
End If
On Error Goto 0
End Function


Function CompareFileVersions(sFileInfo1, sFileInfo2)
Dim oFSO, sFileVer1, sFileVer2, aFileVer1, aFileVer2, iCount, iDateDiff

Set oFSO = CreateObject("Scripting.FileSystemObject")

If sFileInfo1 = "" Or sFileInfo2 = "" Then
MsgBox _
"CompareFileVersions error: Invalid argument, empty argument given!", _
vbExclamation, "CompareFileVersions"
Err.Raise 5 'Invalid procedure call or argument
End If


If oFSO.FileExists(sFileInfo1) Then
sFileVer1 = oFSO.GetFileVersion(sFileInfo1)
Elseif UBound(Split(sFileInfo1, ".")) = 3 Then
sFileVer1 = sFileInfo1
Else
MsgBox "CompareFileVersions error: 1. argument is not an existing file " _
& "or correct file version format: " & sFileInfo1, _
vbExclamation, "CompareFileVersions"
Err.Raise 5 'Invalid procedure call or argument
End If

If oFSO.FileExists(sFileInfo2) Then
sFileVer2 = oFSO.GetFileVersion(sFileInfo2)
Elseif UBound(Split(sFileInfo2, ".")) = 3 Then
sFileVer2 = sFileInfo2
Else
MsgBox "CompareFileVersions error: 2. argument is not an existing file " _
& "or correct file version format: " & sFileInfo2, _
vbExclamation, "CompareFileVersions"
Err.Raise 5 'Invalid procedure call or argument
End If

If sFileVer1 <> "" And sFileVer2 <> "" Then
If sFileVer1 = sFileVer2 Then
CompareFileVersions = "SameVersion"
Else
aFileVer1 = Split(sFileVer1, ".")
aFileVer2 = Split(sFileVer2, ".")
For iCount = 0 To 3
If CInt(aFileVer1(iCount)) > CInt(aFileVer2(iCount)) Then
CompareFileVersions = "FirstFileNewest"
Exit For
ElseIf CInt(aFileVer1(iCount)) < CInt(aFileVer2(iCount)) Then
CompareFileVersions = "SecondFileNewest"
Exit For
Else
CompareFileVersions = "UnknownStatus"
End If
Next
End If

Elseif sFileVer1 <> "" And sFileVer2 = "" Then
CompareFileVersions = "FirstFileNewest"
Elseif sFileVer1 = "" And sFileVer2 <> "" Then
CompareFileVersions = "SecondFileNewest"
Else
iDateDiff = DateDiff("s", oFSO.GetFile(sFileInfo1).DateLastModified, _
oFSO.GetFile(sFileInfo2).DateLastModified)
If iDateDiff < 0 Then
CompareFileVersions = "FirstFileNewest"
ElseIf iDateDiff > 0 Then
CompareFileVersions = "SecondFileNewest"
Else
CompareFileVersions = "SameVersion"
End If
End If
End Function


--
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


news.microsoft.com

unread,
Nov 19, 2003, 6:11:07 PM11/19/03
to
Thanks for the code, looks complicated, I guess I should have stated that my
primary interests are office 97, office 98 and office 2k. Is their a way to
check 97 and 98? Your help is greatly appreciated.
"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message
news:3FBAE0DD...@hydro.com...

Torgeir Bakken (MVP)

unread,
Nov 20, 2003, 6:30:35 AM11/20/03
to
"news.microsoft.com" wrote:

> Thanks for the code, looks complicated, I guess I should have stated that my
> primary interests are office 97, office 98 and office 2k. Is their a way to
> check 97 and 98? Your help is greatly appreciated.

I think you are in for a nightmare if you want to script something (and be sure it is correct) for
all those old versions of the product. If you upgrade to Office 2k or better on all computers, you
will save yourself for a lot of grief.

Also note that e.g. Microsoft Baseline Security Analyzer (MBSA) supports only Microsoft Office
2000 and up.

news.microsoft.com

unread,
Nov 24, 2003, 7:57:11 PM11/24/03
to
Unfortunatly upgrading is not an option in my current environement.
Although I would very much like to :-)

"Torgeir Bakken (MVP)" <Torgeir.B...@hydro.com> wrote in message

news:3FBCA5DB...@hydro.com...

0 new messages