You can detect the path and service pack by using the VB Script below
(modify as needed):
Dim i
Dim strPath
Dim strVersion
For i = 8 to 11
strPath = GetAccessPath(i)
strVersion = GetVersion(strPath)
If Len(strPath) Then
msgbox "Microsoft Access version " & strVersion & " is installed at
" & strPath,64,"Found It"
End if
Next
Function GetAccessPath(Version)
Dim wsh
Dim strValue
On error resume next
Set wsh = CreateObject("Wscript.Shell")
strValue = wsh.RegRead("HKCR\Access.Application." & Version &
"\Shell\Open\Command\")
GetAccessPath = StripIt(strValue)
End Function
Function StripIt(Arg)
'Removes any command line parameters or quotes from the string
If InStr(Arg, "/") > 0 Then
StripIt = Trim(Left(Arg, InStr(Arg, "/") - 1))
Else
StripIt = Arg
End If
If Left(StripIt, 1) = Chr(34) Then
StripIt = Mid(StripIt, 2)
End If
If Right(StripIt, 1) = Chr(34) Then
StripIt = Left(StripIt, Len(StripIt) - 1)
End If
End Function
Function GetVersion(FilePath)
'Returns version for FilePath
Dim fso, temp
On Error Resume Next
Set fso = CreateObject("Scripting.FileSystemObject")
temp = fso.GetFileVersion(FilePath)
If Len(temp) Then
GetVersion = temp
Else
GetVersion = 0
End If
End Function