久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 VBS 和注冊表來確定安裝了哪個版本和 32 位

Using VBS and the registry to determine which version and 32 vs. 64 bit oracle drivers are installed(使用 VBS 和注冊表來確定安裝了哪個版本和 32 位與 64 位的 oracle 驅動程序) - IT屋-程序員軟件開發技術分享社
本文介紹了使用 VBS 和注冊表來確定安裝了哪個版本和 32 位與 64 位的 oracle 驅動程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我想使用 VBS 讀取注冊表以列出服務器上的一些信息,包括驅動程序.VBS:

I'd like to use VBS to read the registry to list some info on a server including the drivers. VBS:

REM Run this file with the following command:
REM cscript  drivers.vbs | clip

WScript.Echo "------------------------------------------------"

Const HKEY_LOCAL_MACHINE = &H80000002

'Get Server Name
Set wshNetwork = WScript.CreateObject( "WScript.Network" )
strComputerName = wshNetwork.ComputerName
WScript.Echo "Computer Name: " & strComputerName

'Get Driver Names  
strComputer = "."

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"
objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes


For i = 0 to UBound(arrValueNames)
    strValueName = arrValueNames(i)
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    
    Wscript.Echo arrValueNames(i) & " -- " & strValue
Next

Set objShell = WScript.CreateObject("WScript.Shell")

'Get Oracle Environment variables
WScript.Echo "TNS_ADMIN=" & objShell.Environment("SYSTEM").Item("TNS_ADMIN")
WScript.Echo "ORACLE_HOME=" & objShell.Environment("SYSTEM").Item("ORACLE_HOME")


WScript.Echo "------------------------------------------------"

輸出:

------------------------------------------------
Computer Name: WLDL2532
SQL Server -- Installed
Client Access ODBC Driver (32-bit) -- Installed
iSeries Access ODBC Driver -- Installed
SQL Server Native Client 10.0 -- Installed
**Oracle in OraClient11g_home1 -- Installed**
IBM DB2 ODBC DRIVER - DB2_976_64 -- Installed
IBM DB2 ODBC DRIVER -- Installed
ODBC Driver 11 for SQL Server -- Installed
DataDirect 6.1 Sybase Wire Protocol -- Installed
SQL Server Native Client 11.0 -- Installed
TNS_ADMIN=C:\WINDOWS\TNS
ORACLE_HOME=
------------------------------------------------

問題我想知道如何單獨列出是否安裝了32位驅動程序或64位Oracle驅動程序.我的機器上都有,但沒有顯示哪個.據推測,它可能意味著兩者或其中之一,我假設.通常,如果找到 32 位驅動程序,我希望在名稱中看到32".你能幫我嗎?謝謝!

Question I'd like to know how to seperately list if the 32 bit driver or the 64 bit Oracle driver is installed. I have both on my machine, but it doesn't indicate which. Presumably, it can mean both or either, I assume. Normally, if a 32 bit driver were found, I'd expect to see "32" in the name. Can you help? Thank you!

如果您知道最好在注冊表中的哪個位置查找此信息,如果您不知道代碼,這也會很有幫助.

if you know where to best look in the registry for this info, that would be helpful, too, if you don't know the code off hand.

推薦答案

根據您的 VBS 代碼,問題應該是:使用 VBS 和注冊表來確定 ODBC 的版本和 32 位與 64 位 驅動程序已安裝

According to your VBS code the question should be: Using VBS and the registry to determine which version and 32 vs. 64 bit of ODBC drivers are installed

還有許多其他可用于 Oracle 的驅動程序,例如OleDB、ODP.NET、JDBC 等

There are many other drivers available for Oracle, e.g. OleDB, ODP.NET, JDBC, etc.

為了獲得 32 位和 64 位,您可以通過兩種方式進行

In order to get 32 and 64 bit you can do it in two ways

要么在不同的腳本宿主中運行VBS,即

Either run the VBS in different scripting host, i.e.

For 64 Bit: >c:\Windows\system32\cscript.exe Drivers.vbs
For 32 Bit: >c:\Windows\SysWOW64\cscript.exe Drivers.vbs

或修改 VBS 腳本以查詢注冊表中的 32 位和 64 位路徑:

Or modify the VBS script in order to interrogate 32 and 64 Bit path in Registry:

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers"
objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes

For i = 0 to UBound(arrValueNames)
    strValueName = arrValueNames(i)
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    
    Wscript.Echo arrValueNames(i) & " -- 64 Bit " & strValue
Next

strKeyPath = "SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers"
objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes

For i = 0 to UBound(arrValueNames)
    strValueName = arrValueNames(i)
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue    
    Wscript.Echo arrValueNames(i) & " -- 32 Bit " & strValue
Next

另一個注意事項:TNS_ADMINORACLE_HOME 可以通過環境變量定義,但是您也可以在注冊表中定義它們.檢查 64 位

Another note: TNS_ADMINand ORACLE_HOME can be defined by environment variable, however you can defined them also in the Registry. Check for 64 bit

HKLM\SOFTWARE\ORACLE\Key_{ORACLE_HOME_NAME}\TNS_ADMIN 
and 
HKLM\SOFTWARE\ORACLE\Key_{ORACLE_HOME_NAME}\ORACLE_HOME

和 32 位

HKLM\SOFTWARE\Wow6432Node\ORACLE\Key_{ORACLE_HOME_NAME}\TNS_ADMIN
and
HKLM\SOFTWARE\Wow6432Node\ORACLE\Key_{ORACLE_HOME_NAME}\ORACLE_HOME

這篇關于使用 VBS 和注冊表來確定安裝了哪個版本和 32 位與 64 位的 oracle 驅動程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

What SQL Server Datatype Should I Use To Store A Byte[](我應該使用什么 SQL Server 數據類型來存儲字節 [])
Interpreting type codes in sys.objects in SQL Server(解釋 SQL Server 中 sys.objects 中的類型代碼)
Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
How to convert #39;2016-07-01 01:12:22 PM#39; to #39;2016-07-01 13:12:22#39; hour format?(如何將“2016-07-01 01:12:22 PM轉換為“2016-07-01 13:12:22小時格式?)
Convert multiple sub-queries to on join(將多個子查詢轉換為 on join)
How do I get the minute difference between 2 times in T SQL?(如何獲得 T SQL 中 2 次之間的微小差異?)
主站蜘蛛池模板: 男女羞羞视频在线看 | 天堂视频中文在线 | 天天射天天干 | 国产一区二区精品在线 | 国产日韩欧美精品一区二区 | 精品视频在线免费观看 | 欧美极品少妇xxxxⅹ免费视频 | 在线看片国产 | 91精品国产一区 | 天天干夜夜操 | 在线观看av网站永久 | 国产超碰人人爽人人做人人爱 | 免费成人高清在线视频 | 国产黄色在线观看 | 亚洲精品乱码久久久久久久久久 | 久久久精品一区二区三区四季av | 国产精品国产馆在线真实露脸 | 天天操狠狠操 | 国产精品美女久久久久aⅴ国产馆 | 成人深夜福利 | 精品国产视频 | 久久大陆 | 欧美成人精品一区二区男人看 | 99国产精品一区二区三区 | 国产最好的av国产大片 | 午夜色婷婷 | 国产精品欧美一区二区三区不卡 | 欧美黄色一区 | 亚洲精品欧美 | 国产成人精品一区二区三 | 日韩欧美精品 | 欧美黄色一级毛片 | 国产精品久久久久免费 | 色爱综合网 | 黄色大片在线免费观看 | 欧美日韩一区二区三区不卡视频 | 国产精品欧美精品 | 精品国产精品国产偷麻豆 | 欧美成年网站 | 五月激情久久 | 国产成人网|