インストールされているアプリケーションをリストアップするvbs
今勤めている会社は、クライアントPCの数が1200台前後で、PCの入れ替え作業の際にそのPCにインストールされているアプリケーションが何だったのかを自動的に取得できるスクリプトを一生懸命考えたことがあり、昔に一度作ったのだがあまりきれいなやり方ではなかったので、最近勉強中のWMI 使ってうまくできないかなぁと思ったら、できた!
下記スクリプトの実行結果は、コントロールパネルのアプリケーションの追加と削除で表示される内容と一緒のはず。
Option Explicit Dim strComputer Dim refRegistry Dim strKeyPath Dim retval Dim arrSubKeys Dim SubKey Dim strAppsName strComputer = "." 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) For each SubKey in arrSubKeys retval = refRegistry.GetStringValue (HKEY_LOCAL_MACHINE,strKeyPath & "\" &_ subkey, "DisplayName", strAppsName) If strAppsName"" then Wscript.Echo strAppsName End if Next