Obs.: nada é instalado na máquina, apenas uma mensagem é exibida.
Agradeço
- Anexos
- DetectaAccess.zip
- Você não tem permissão para fazer download dos arquivos anexados.
- (303 Kb) Baixado 59 vez(es)
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\VersãoApplicationDoOffice\Outlook\Bitness
ArchitecturesInstallIn64BitMode=x64
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MSACCESS.EXE\Path
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\Outlook\Bitness
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\16.0\Outlook\Bitness
Option Explicit
'ahteixeira 2019 para MaximoAccess
Dim oShell
Dim sTemp
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
sTemp = oShell.RegRead("HKCR\Access.Application\CurVer\")
If Len(sTemp & "") > 2 Then sTemp= Replace(Right(sTemp, 2), ".", "")
MsgBox sTemp
option explicit
const HKLM = &H80000002
const SEMERRO = 0
dim objEdReg
dim strVerAcc
Set objEdReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "Path", strVerAcc) <> SEMERRO then
call msgbox("Nenhuma versão Access detectada.", vbinformation,"Ops...")
else
strVerAcc = right(strVerAcc, 3)
strVerAcc = left(strVerAcc, 2)
select case strVerAcc
case "12"
call msgbox("Access 2007 " & Bits(), vbinformation, "Informação")
case "14"
call msgbox("Access 2010 " & Bits(), vbinformation, "Informação")
case "15"
call msgbox("Access 2013 " & Bits(), vbinformation, "Informação")
case "16"
call fncTrabalhaVersao16
case else
call msgbox("Você é de outro mundo por está muito atualizado ou muito desatualizado.", vbexclamation, "Alienígena")
end select
end if
set objEdReg = nothing
sub fncTrabalhaVersao16()
dim strKeyPath
dim arrSubKeys
dim subkey
dim strVerOffice
if win64 and Bits() = "32 bits" then
strKeyPath = "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
call objEdReg.EnumKey(HKLM, strKeyPath, arrSubKeys)
for each subkey in arrSubKeys
if left(subkey, 1) <> "{" Then
call objEdReg.GetStringValue(HKLM, strKeyPath & "\" & subkey, "DisplayName", strVerOffice)
if instr(strVerOffice, "Microsoft Office") then
if instr(strVerOffice, "2016") then
call msgbox("Access 2016 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2019") then
call msgbox("Access 2019 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "365") then
call msgbox("Access 365 " & Bits(), vbinformation, "Informação")
exit sub
end if
end if
end if
next
call msgbox("Access desconhecido.", vbexclamation, "Ops...")
end sub
function win64()
dim objWMIService
dim colOperatingSystems
dim objOperatingSystem
set objWMIService = getObject("winmgmts:\\.\root\cimv2")
set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
for each objOperatingSystem in colOperatingSystems
win64 = instr(objOperatingSystem.OSArchitecture,"64") > 0
next
end function
function Bits()
dim strBits
if win64 then
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\" & strVerAcc & ".0\Outlook", "Bitness", strBits) = SEMERRO then
if strBits = "x64" then
Bits = "64 bits"
else
Bits = "32 bits"
end if
else
Bits = "32 bits"
end if
else
Bits = "32 bits"
end if
end function
option explicit
const HKLM = &H80000002
const SEMERRO = 0
dim objEdReg
dim strVerAcc
dim booClickToRun
Set objEdReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "Path", strVerAcc) <> SEMERRO then
call msgbox("Nenhuma versão Access detectada.", vbinformation,"Ops...")
else
strVerAcc = right(strVerAcc, 3)
strVerAcc = left(strVerAcc, 2)
select case strVerAcc
case "12"
call msgbox("Access 2007 " & Bits(), vbinformation, "Informação")
case "14"
call msgbox("Access 2010 " & Bits(), vbinformation, "Informação")
case "15"
call msgbox("Access 2013 " & Bits(), vbinformation, "Informação")
case "16"
call fncTrabalhaVersao16
case else
call msgbox("Você é de outro mundo por está muito atualizado ou muito desatualizado.", vbexclamation, "Alienígena")
end select
end if
set objEdReg = nothing
sub fncTrabalhaVersao16()
dim strKeyPath
dim arrSubKeys
dim subkey
dim strVerOffice
booClickToRun = false
if win64 then
if Bits() = "32 bits" then
if not booClickToRun then
strKeyPath = "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
call objEdReg.EnumKey(HKLM, strKeyPath, arrSubKeys)
for each subkey in arrSubKeys
if left(subkey, 1) <> "{" Then
call objEdReg.GetStringValue(HKLM, strKeyPath & "\" & subkey, "DisplayName", strVerOffice)
if instr(strVerOffice, "Microsoft Office") or instr(strVerOffice, "Microsoft Access") or instr(strVerOffice, "Microsoft 365") then
if instr(strVerOffice, "2016") and left(subkey, 9)="Office16." then
call msgbox("Access 2016 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2019") then
call msgbox("Access 2019 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2021") then
call msgbox("Access 2021 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "365") or (instr(strVerOffice, "2016") and left(subkey, 9)<>"Office16.") then
call msgbox("Access 365 " & Bits(), vbinformation, "Informação")
exit sub
end if
end if
end if
next
call msgbox("Access desconhecido.", vbexclamation, "Ops...")
end sub
function win64()
dim objWMIService
dim colOperatingSystems
dim objOperatingSystem
set objWMIService = getObject("winmgmts:\\.\root\cimv2")
set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
for each objOperatingSystem in colOperatingSystems
win64 = instr(objOperatingSystem.OSArchitecture,"64") > 0
next
end function
function Bits()
dim strBits
strBits = ""
if not win64 then
Bits = "32 bits"
exit function
end if
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\" & strVerAcc & ".0\Outlook", "Bitness", strBits) <> SEMERRO then
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\ClickToRun\Configuration", "Platform", strBits) = SEMERRO then
booClickToRun = true
else
Bits = "32 bits"
exit function
end if
end if
if strBits = "x64" then
Bits = "64 bits"
else
Bits = "32 bits"
end if
end function
DamascenoJr. gosta desta mensagem
DamascenoJr. gosta desta mensagem
option explicit
'update 22-04-2022
const HKLM = &H80000002
const SEMERRO = 0
dim objEdReg
dim strVerAcc
dim booClickToRun
Set objEdReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "Path", strVerAcc) <> SEMERRO then
call msgbox("Nenhuma versão Access detectada.", vbinformation,"Ops...")
else
strVerAcc = right(strVerAcc, 3)
strVerAcc = left(strVerAcc, 2)
select case strVerAcc
Case "11"
Call MsgBox("Access 2003 32 bits", vbInformation, "Informação")
case "12"
call msgbox("Access 2007 " & Bits(), vbinformation, "Informação")
case "14"
call msgbox("Access 2010 " & Bits(), vbinformation, "Informação")
case "15"
call msgbox("Access 2013 " & Bits(), vbinformation, "Informação")
case "16"
call fncTrabalhaVersao16
case else
call msgbox("Você é de outro mundo por está muito atualizado ou muito desatualizado.", vbexclamation, "Alienígena")
end select
end if
set objEdReg = nothing
sub fncTrabalhaVersao16()
dim strKeyPath
dim arrSubKeys
dim subkey
dim strVerOffice
booClickToRun = false
if win64 then
if Bits() = "32 bits" then
if not booClickToRun then
strKeyPath = "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
call objEdReg.EnumKey(HKLM, strKeyPath, arrSubKeys)
for each subkey in arrSubKeys
if left(subkey, 1) <> "{" Then
call objEdReg.GetStringValue(HKLM, strKeyPath & "\" & subkey, "DisplayName", strVerOffice)
if instr(strVerOffice, "Microsoft Office") or instr(strVerOffice, "Microsoft Access") then
if instr(strVerOffice, "2016") then
call msgbox("Access 2016 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2019") then
call msgbox("Access 2019 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2021") then
call msgbox("Access 2021 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "365") then
call msgbox("Access 365 " & Bits(), vbinformation, "Informação")
exit sub
end if
end if
end if
next
call msgbox("Access desconhecido.", vbexclamation, "Ops...")
end sub
function win64()
dim objWMIService
dim colOperatingSystems
dim objOperatingSystem
set objWMIService = getObject("winmgmts:\\.\root\cimv2")
set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
for each objOperatingSystem in colOperatingSystems
win64 = instr(objOperatingSystem.OSArchitecture,"64") > 0
next
end function
function Bits()
dim strBits
strBits = ""
if not win64 then
Bits = "32 bits"
exit function
end if
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\" & strVerAcc & ".0\Outlook", "Bitness", strBits) <> SEMERRO then
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\ClickToRun\Configuration", "Platform", strBits) = SEMERRO then
booClickToRun = true
else
Bits = "32 bits"
exit function
end if
end if
if strBits = "x64" then
Bits = "64 bits"
else
Bits = "32 bits"
end if
end function
Option Explicit
Const HKLM = &H80000002
Const SEMERRO = 0
Public objEdReg
Public strVerAcc
Public booClickToRun
Public Sub teste()
Set objEdReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
If objEdReg.GetStringValue(HKLM, "Software\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "Path", strVerAcc) <> SEMERRO Then
Call MsgBox("Nenhuma versão Access detectada.", vbInformation, "Ops...")
Else
strVerAcc = Right(strVerAcc, 3)
strVerAcc = Left(strVerAcc, 2)
Select Case strVerAcc
Case "12"
Call MsgBox("Access 2007 " & Bits(), vbInformation, "Informação")
Case "14"
Call MsgBox("Access 2010 " & Bits(), vbInformation, "Informação")
Case "15"
Call MsgBox("Access 2013 " & Bits(), vbInformation, "Informação")
Case "16"
Call fncTrabalhaVersao16
Case Else
Call MsgBox("Você é de outro mundo por está muito atualizado ou muito desatualizado.", vbExclamation, "Alienígena")
End Select
End If
Set objEdReg = Nothing
End Sub
Sub fncTrabalhaVersao16()
Dim strKeyPath
Dim arrSubKeys
Dim subkey
Dim strVerOffice
booClickToRun = False
If win64 Then
If Bits() = "32 bits" Then
If Not booClickToRun Then
strKeyPath = "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
Else
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
End If
Else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
End If
Else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
End If
Call objEdReg.EnumKey(HKLM, strKeyPath, arrSubKeys)
For Each subkey In arrSubKeys
If Left(subkey, 1) <> "{" Then
Call objEdReg.GetStringValue(&H80000002, strKeyPath & "\" & subkey, "DisplayName", strVerOffice)
If InStr(strVerOffice, "Microsoft Office") Or InStr(strVerOffice, "Microsoft Access") Then
If InStr(strVerOffice, "2016") Then
Call MsgBox("Access 2016 " & Bits(), vbInformation, "Informação")
Exit Sub
ElseIf InStr(strVerOffice, "2019") Then
Call MsgBox("Access 2019 " & Bits(), vbInformation, "Informação")
Exit Sub
ElseIf InStr(strVerOffice, "365") Then
Call MsgBox("Access 365 " & Bits(), vbInformation, "Informação")
Exit Sub
End If
End If
End If
Next
Call MsgBox("Access desconhecido.", vbExclamation, "Ops...")
End Sub
Function win64()
Dim objWMIService
Dim colOperatingSystems
Dim objOperatingSystem
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
For Each objOperatingSystem In colOperatingSystems
win64 = InStr(objOperatingSystem.OSArchitecture, "64") > 0
Next
End Function
Function Bits()
Dim strBits
strBits = ""
If Not win64 Then
Bits = "32 bits"
Exit Function
End If
If objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\" & strVerAcc & ".0\Outlook", "Bitness", strBits) <> SEMERRO Then
If objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\ClickToRun\Configuration", "Platform", strBits) = SEMERRO Then
booClickToRun = True
Else
Bits = "32 bits"
Exit Function
End If
End If
If strBits = "x64" Then
Bits = "64 bits"
Else
Bits = "32 bits"
End If
End Function
option explicit
'Updated 19-10-2023 by Alvaro Teixeira to MaximoAccess.com
const HKLM = &H80000002
const SEMERRO = 0
dim objEdReg
dim strVerAcc
dim booClickToRun
Set objEdReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "Path", strVerAcc) <> SEMERRO then
call msgbox("Nenhuma versão Access detectada.", vbinformation,"Ops...")
else
strVerAcc = right(strVerAcc, 3)
strVerAcc = left(strVerAcc, 2)
select case strVerAcc
Case "11"
Call MsgBox("Access 2003 32 bits", vbInformation, "Informação")
case "12"
call msgbox("Access 2007 " & Bits(), vbinformation, "Informação")
case "14"
call msgbox("Access 2010 " & Bits(), vbinformation, "Informação")
case "15"
call msgbox("Access 2013 " & Bits(), vbinformation, "Informação")
case "16"
call fncTrabalhaVersao16
case else
call msgbox("Você é de outro mundo por está muito atualizado ou muito desatualizado.", vbexclamation, "Alienígena")
end select
end if
set objEdReg = nothing
sub fncTrabalhaVersao16()
dim strKeyPath
dim arrSubKeys
dim subkey
dim strVerOffice
booClickToRun = false
if win64 then
if Bits() = "32 bits" then
if not booClickToRun then
strKeyPath = "Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
else
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall"
end if
call objEdReg.EnumKey(HKLM, strKeyPath, arrSubKeys)
for each subkey in arrSubKeys
if left(subkey, 1) <> "{" Then
call objEdReg.GetStringValue(HKLM, strKeyPath & "\" & subkey, "DisplayName", strVerOffice)
if instr(strVerOffice, "Microsoft Office") or instr(strVerOffice, "Microsoft Access") or instr(strVerOffice, "Microsoft 365") then
if instr(strVerOffice, "2016") then
call msgbox("Access 2016 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2019") then
call msgbox("Access 2019 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "2021") then
call msgbox("Access 2021 " & Bits(), vbinformation, "Informação")
exit sub
elseif instr(strVerOffice, "365") then
call msgbox("Access 365 " & Bits(), vbinformation, "Informação")
exit sub
end if
end if
end if
next
call msgbox(strVerOffice &"1", vbinformation, "Informação")
call msgbox("Access desconhecido.", vbexclamation, "Ops...")
end sub
function win64()
dim objWMIService
dim colOperatingSystems
dim objOperatingSystem
set objWMIService = getObject("winmgmts:\\.\root\cimv2")
set colOperatingSystems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
for each objOperatingSystem in colOperatingSystems
win64 = instr(objOperatingSystem.OSArchitecture,"64") > 0
next
end function
function Bits()
dim strBits
strBits = ""
if not win64 then
Bits = "32 bits"
exit function
end if
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\" & strVerAcc & ".0\Outlook", "Bitness", strBits) <> SEMERRO then
if objEdReg.GetStringValue(HKLM, "Software\Microsoft\Office\ClickToRun\Configuration", "Platform", strBits) = SEMERRO then
booClickToRun = true
else
Bits = "32 bits"
exit function
end if
end if
if strBits = "x64" then
Bits = "64 bits"
else
Bits = "32 bits"
end if
end function