今勤めている会社は、クライアント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
by h5y1m141
| 2004-12-17 14:45
| 業界動向
|
他のブログやツールなど
タグ
読書メモ(186)
ビジネス(60) 日記(51) キャリア(44) ネタ(40) lifehacks(31) script(24) お店(22) money(21) 料理(19) IT(16) 4行日記(16) TIPS(15) relax(15) イベント(14) 写真(11) js(7) perl(6) wmi(6) パン(6) 以前の記事
2009年 08月 2009年 07月 2009年 06月 2009年 05月 2009年 04月 2009年 03月 2009年 02月 2009年 01月 2008年 12月 2008年 11月 2008年 10月 2008年 09月 2008年 08月 2008年 07月 2008年 06月 2008年 05月 2008年 04月 2008年 03月 2008年 02月 2008年 01月 2007年 12月 2007年 11月 2007年 10月 2007年 09月 2007年 08月 2007年 07月 2007年 06月 2007年 05月 2007年 04月 2007年 03月 2007年 02月 2007年 01月 2006年 12月 2006年 11月 2006年 10月 2006年 09月 2006年 08月 2006年 07月 2006年 06月 2006年 05月 2006年 04月 2006年 03月 2006年 02月 2006年 01月 2005年 12月 2005年 11月 2005年 10月 2005年 09月 2005年 08月 2005年 07月 2005年 06月 2005年 05月 2005年 04月 2005年 03月 2005年 02月 2005年 01月 2004年 12月 2004年 07月 最新のトラックバック
その他のジャンル
ファン
記事ランキング
ブログジャンル
画像一覧
|
ファン申請 |
||