可能であらば、新たにPC構成管理専用ソフトなどをインストールすることなくデータを保存したいです。それがダメならフリーのPC構成管理専用ソフトの情報を教えていただけないでしょうか。
こんなものも
http://www.forest.impress.co.jp/article/2005/07/06/safarp.html
インストール済みソフトのリストをCSV/HTML/RTF形式で保存する機能もあり
私も#1の方が紹介されたPCVIEWを使っていますが...
http://www.microsoft.com/japan/technet/scriptcenter/resources/wm...
を参考にして
strHost = "." Const HKLM = &H80000002 Set fs = WScript.CreateObject("Scripting.FileSystemObject") fs.CreateTextFile "appl.txt" Set applf = fs.CreateTextFile("appl.txt") Const strBaseKey = _ "Software\Microsoft\Windows\CurrentVersion\Uninstall\" Set objReg = GetObject("winmgmts://" & strHost & _ "/root/default:StdRegProv") objReg.EnumKey HKLM, strBaseKey, arrSubKeys For Each strSubKey In arrSubKeys intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey, _ "DisplayName", strValue) If intRet <> 0 Then intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey, _ "QuietDisplayName", strValue) End If If (strValue <> "") and (intRet = 0) Then applf.Write strValue & vbcrlf End If Next applf.Close Set applf = Nothing Set fs = Nothing
ファイル名appl.txtは適宜変更してください。
以下のスクリプトをxxxxx.vbsという名前(xxxxxは適当な名前を付けてください)で保存してコマンドラインから「cscript xxxxx.vbs」を実行すればプログラムの一覧を表示できます。
Const HKEY_LOCAL_MACHINE = &H80000002 Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") unKeyPath = "Software\Microsoft\Windows\CurrentVersion\Uninstall" objReg.EnumKey HKEY_LOCAL_MACHINE, unKeyPath, arrSubKeys For Each Subkey in arrSubKeys objReg.GetStringValue HKEY_LOCAL_MACHINE, unKeyPath & "\" & subkey, "DisplayName", strValue If Not IsNull(strValue) Then Wscript.Echo strValue End If Next wscript.Quit
少し改造すれば、プログラム名以外の情報なども取得できます。またファイルに保存したければそのように改造することもできます。
テキストファイルに書くだけであれば「cscript xxxxx.vbs > list.txt」とするだけでもいいですが。
URLはダミー
回答者 | 回答 | 受取 | ベストアンサー | 回答時間 | |
---|---|---|---|---|---|
1 | lizy | 45回 | 42回 | 14回 | 2007-07-26 23:39:51 |
コメント(1件)
を参考に
strHost = "."
Const HKLM = &H80000002
Set fs = WScript.CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile "appl.txt"
Set applf = fs.CreateTextFile("appl.txt")
Const strBaseKey = _
"Software\Microsoft\Windows\CurrentVersion\Uninstall\"
Set objReg = GetObject("winmgmts://" & strHost & _
"/root/default:StdRegProv")
objReg.EnumKey HKLM, strBaseKey, arrSubKeys
For Each strSubKey In arrSubKeys
intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey, _
"DisplayName", strValue)
If intRet <> 0 Then
intRet = objReg.GetStringValue(HKLM, strBaseKey & strSubKey, _
"QuietDisplayName", strValue)
End If
If (strValue <> "") and (intRet = 0) Then
applf.Write strValue & vbcrlf
End If
Next
applf.Close
Set applf = Nothing
Set fs = Nothing
と解答しました。