久しぶりのVBスクリプトです。
Windows7用にインストールされたアプリケーションを取得するスクリプトを作っていて、アプリケーション一覧が上手く取得出来なかったのですが、レジストリ値を調べてみたところ64Bit版OSの場合は参照しなくてはならないレジストリ値が2箇所あるようでした。
手抜きですが、一覧取得出来るスクリプトを作ってみました。
Option Explicit Dim strComputer strComputer = "." Call Query_InstalledAPP() Sub Query_InstalledAPP() Dim refRegistry Dim strKeyPath Dim retval Dim arrSubKeys Dim SubKey Dim strAppsName Const HKEY_LOCAL_MACHINE = &H80000002 Set refRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" retval = refRegistry.EnumKey(HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys) If isNull(arrSubKeys) = False Then For each SubKey in arrSubKeys retval = refRegistry.GetStringValue (HKEY_LOCAL_MACHINE,strKeyPath & "\" &_ subkey,"DisplayName",strAppsName) If strAppsName<>"" then Wscript.Echo strAppsName End if Next End If '64bit OS用 strKeyPath = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall" retval = refRegistry.EnumKey(HKEY_LOCAL_MACHINE,strKeyPath,arrSubKeys) If isNull(arrSubKeys) = False Then For each SubKey in arrSubKeys retval = refRegistry.GetStringValue (HKEY_LOCAL_MACHINE,strKeyPath & "\" &_ subkey,"DisplayName",strAppsName) If strAppsName<>"" then Wscript.Echo strAppsName End if Next End If End Sub
助かりました。(^-^)