' ===================================================================== ' Auto-Elevation Check: Request Administrator rights if not already elevated ' ===================================================================== If Not WScript.Arguments.Named.Exists("elevate") Then CreateObject("Shell.Application").ShellExecute WScript.FullName _ , """" & WScript.ScriptFullName & """ /elevate", "", "runas", 1 WScript.Quit End If Dim objShell Set objShell = CreateObject("WScript.Shell") ' ===================================================================== ' Helper Subroutine for Auto-Closing Notifications ' The '2' means the popup will automatically close after 2 seconds ' The '64' adds the Information (i) icon to the message box ' ===================================================================== Sub ShowNotification(strMessage, strTitle) objShell.Popup strMessage, 2, strTitle, 64 End Sub ' ===================================================================== ' Step 1: Download accessdatabaseengine.exe to C:\ ' ===================================================================== ShowNotification "Downloading Access Database Engine to C:\..." & vbCrLf & _ "This may take a moment depending on your connection.", "Step 1 of 4" Dim strUrl, strSavePath strUrl = "https://download.microsoft.com/download/3/5/c/35c84c36-661a-44e6-9324-8786b8dbe231/accessdatabaseengine.exe" strSavePath = "C:\accessdatabaseengine.exe" Dim objXMLHTTP, objStream Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP") objXMLHTTP.Open "GET", strUrl, False objXMLHTTP.Send If objXMLHTTP.Status = 200 Then Set objStream = CreateObject("ADODB.Stream") objStream.Open objStream.Type = 1 ' adTypeBinary objStream.Write objXMLHTTP.ResponseBody objStream.Position = 0 objStream.SaveToFile strSavePath, 2 ' 2 = adSaveCreateOverWrite objStream.Close Set objStream = Nothing Else MsgBox "Download failed. HTTP Status: " & objXMLHTTP.Status, 16, "Error" WScript.Quit End If Set objXMLHTTP = Nothing ' ===================================================================== ' Step 2: Register msjet40.dll ' ===================================================================== ShowNotification "Download complete." & vbCrLf & _ "Registering msjet40.dll...", "Step 2 of 4" objShell.Run "regsvr32.exe /s ""C:\Windows\SysWOW64\msjet40.dll""", 0, True ' ===================================================================== ' Step 3: Register msjetoledb40.dll ' ===================================================================== ShowNotification "msjet40.dll registered." & vbCrLf & _ "Registering msjetoledb40.dll...", "Step 3 of 4" objShell.Run "regsvr32.exe /s ""C:\Windows\SysWOW64\msjetoledb40.dll""", 0, True ' ===================================================================== ' Step 4: Silent Installation ' ===================================================================== ShowNotification "DLLs successfully registered." & vbCrLf & _ "Executing silent installation...", "Step 4 of 4" objShell.Run "cmd.exe /c """ & strSavePath & """ /quiet", 0, True ' ===================================================================== ' Completion Notification (Requires manual click to close) ' ===================================================================== MsgBox "Database Engine setup completed successfully!" & vbCrLf & vbCrLf & _ "All legacy OLEDB drivers and the access engine are now ready.", 64, "Process Complete"