5
A
回答
6
我在回答我自己的問題,因爲很難發現我的預期。 Google-fu只能回答我的部分問題;我需要綜合來自各種博客條目和官方文檔的信息。
下面是VBScript,您可以複製/粘貼到文本文件並在Windows上運行。您不需要本地管理員權限來運行此版本。
根據註冊表的大小和CPU的速度,可能需要長達一分鐘的時間才能運行。結果是帶有文本的消息框可以使用Ctrl+C
複製到剪貼板。
主要參考:https://sysmod.wordpress.com/2014/07/11/vbscript-to-list-installed-oledb-providers/
'List of installed OLEDB providers on local computer
Option Explicit
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_CONFIG = &H80000005
Dim OutText, strComputer, objRegistry
Dim num
Dim ProgIdDict
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
OutText = "Note: Strike Ctrl+C to copy full text to clipboard"
Num = 1
Set ProgIdDict = CreateObject("Scripting.Dictionary")
' I discovered these registrations can appear in three different places.
' Use ProgIdDict to prevent dupes in the output
Append objRegistry, HKEY_CLASSES_ROOT, "HKEY_CLASSES_ROOT", "CLSID", ProgIdDict, Num, OutText
Append objRegistry, HKEY_LOCAL_MACHINE, "HKEY_LOCAL_MACHINE", "SOFTWARE\Classes\CLSID", ProgIdDict, Num, OutText
Append objRegistry, HKEY_LOCAL_MACHINE, "HKEY_LOCAL_MACHINE", "SOFTWARE\Classes\Wow6432Node\CLSID", ProgIdDict, Num, OutText
Sub Append(ByVal objRegistry, ByVal HKEYConstant, ByVal HKEYConstantStr, ByVal KeyPrefixStr, ByVal ProgIdDict, ByRef Num, ByRef OutText)
Dim Key, arrKeys
Dim strKeyPath, strValue, uValue
objRegistry.enumKey HKEYConstant, KeyPrefixStr, arrKeys
for each key in arrKeys
strKeyPath = KeyPrefixStr & "\" & key
' if key exists...
' I noticed something weird where non-MSOLAP entries use the first style,
' and MSOLAP entries use the second style.
If 0 = objRegistry.GetDWordValue(HKEYConstant, strKeyPath, "OLEDB_SERVICES", uValue) _
Or 0 = objRegistry.GetDWordValue(HKEYConstant, strKeyPath & "\OLEDB_SERVICES", "", uValue) _
Then
objRegistry.GetStringValue HKEYConstant,strKeyPath & "\ProgID","",strValue
If Not ProgIdDict.Exists(strValue) _
Then
ProgIdDict.Add strValue, strValue
OutText=OutText & vbcrlf & vbcrlf
'get the (Default) value which is the name of the provider
objRegistry.GetStringValue HKEYConstant,strKeyPath,"",strValue
OutText=OutText & num & ") " & strValue & vbcrlf & "Key: \\" & HKEYConstantStr & "\" & KeyPrefixStr & "\" & key
' and the expanded description
objRegistry.GetStringValue HKEYConstant,strKeyPath & "\OLE DB Provider","",strValue
OutText=OutText & vbcrlf & "OLE DB Provider: " & strValue
objRegistry.GetStringValue HKEYConstant,strKeyPath & "\ProgID","",strValue
OutText=OutText & vbcrlf & "ProgID: " & strValue
objRegistry.GetStringValue HKEYConstant,strKeyPath & "\VersionIndependentProgID","",strValue
OutText=OutText & vbcrlf & "VersionIndependentProgID: " & strValue
num = 1 + num
End If
end if
next
End Sub
Wscript.Echo OutText
2
如果您有可用的PowerShell,只需粘貼到PowerShell命令提示符這樣的:
foreach ($provider in [System.Data.OleDb.OleDbEnumerator]::GetRootEnumerator())
{
$v = New-Object PSObject
for ($i = 0; $i -lt $provider.FieldCount; $i++)
{
Add-Member -in $v NoteProperty $provider.GetName($i) $provider.GetValue($i)
}
$v
}
信用和更高級的用法: http://dbadailystuff.com/list-all-ole-db-providers-in-powershell
相關問題
- 1. Teradata 15.10.04的OLE DB提供程序?
- 2. 如何獲得MediaCatalogDB OLE DB提供程序?
- 3. OLE DB提供程序「MSDASQL」報錯
- 4. 如何獲取Android中已安裝應用程序的列表?
- 5. 如何獲取已安裝應用程序圖標的列表
- 6. 在ConnectionString中未指定OLE DB提供程序。 「提供商= SQLOLEDB;
- 7. 使用OLE DB提供程序列出Fox Pro中的主鍵?
- 8. Microsoft OLE DB提供程序的ODBC驅動程序錯誤「80040e07」
- 9. Microsoft OLE DB提供程序的ODBC驅動程序錯誤「80040e07」
- 10. Oracle OLE DB提供程序未在SSIS中列出
- 11. MS OLE DB在當前安裝中未提供
- 12. 獲取遠程計算機上已安裝程序的列表
- 13. 獲取已安裝的Windows應用程序的列表
- 14. 獲取已安裝的Android應用程序的列表
- 15. 如何解決「找不到可安裝的ISAM」。錯誤的OLE DB提供程序「Microsoft.ACE.OLEDB.12.0」
- 16. Windows Phone:如何獲取已安裝應用程序的列表以及遠程安裝/刪除應用程序
- 17. cocoa獲取已安裝應用程序的列表
- 18. 在UWP中獲取已安裝的應用程序列表
- 19. 獲取已安裝應用程序的列表
- 20. 獲取已安裝應用程序的Facebook好友列表
- 21. Windows Phone:獲取已安裝應用程序的列表
- 22. 獲取已安裝的Facebook應用程序列表和權限?
- 23. 獲取已安裝應用程序的列表android
- 24. 在Android上獲取並顯示已安裝程序的列表
- 25. 獲取可以啓動的已安裝應用程序列表
- 26. 如何以編程方式獲取已安裝程序的列表
- 27. 如何確定VFPOLEDB提供程序是否已安裝/註冊?
- 28. SSIS:請求的OLE DB提供程序SQLNCLI10.1未註冊
- 29. SQL Server的Microsoft OLE DB提供程序錯誤'80040e09'
- 30. 缺少數據庫的OLE DB提供程序