我有一個腳本可以找到特定的已安裝軟件,但我也無法獲取軟件的版本。例如,假設我收到了所有安裝的Microsoft軟件的列表。這是我到目前爲止:批處理文件以獲取特定的已安裝軟件以及版本
echo software installed > software_list.txt
echo ================= >>software_list.txt
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall temp1.txt
find "Microsoft" temp1.txt| find "DisplayName" > temp2.txt
for /f "tokens=2,3 delims==" %%a in (temp2.txt) do (echo %%a >> software_list.txt)
start notepad "software_list.txt"
del temp1.txt temp2.txt
我怎樣才能從reg出口獲得DisplayVersion?如果我將DisplayName替換爲DisplayVersion,則甚至找不到任何內容。或者,我還有另外一個途徑嗎?
有沒有辦法讓Window Installer安裝的程序的安裝路徑?我的程序是一個Interop Excel插件,只包含.dlls並且沒有可執行文件.exe。看到我的添加/刪除程序和_wmic產品獲取名稱,版本_列表,但不是通過命令_where_ – Kenny
@Kenny:嘗試'InstallLocation'屬性,例如'wmic獲取名稱,InstallLocation'。 – Helen
不幸的是InstallLocation是空的。由於類似的屬性列表,我感覺_wmic_從_HKLM \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall_獲取信息。你也可以從這個註冊表項看到許多有_InstallLocation_missing。 – Kenny