aku1 发表于 2006-6-6 16:56:24 |
查找电脑软体,并输出成htm,哈哈
Const ForWriting = 2 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile("C:\FSO\ScriptLog.htm", ForWriting)
strHost = "." Const HKLM = &H80000002 Set objReg = GetObject("winmgmts://" & strHost & _ "/root/default:StdRegProv") Const strBaseKey = _ "Software\Microsoft\Windows\CurrentVersion\Uninstall\" objReg.EnumKey HKLM, strBaseKey, arrSubKeys
objFile.WriteLine "<html>" objFile.WriteLine "<head>" objFile.WriteLine "<title>Process Report</title>" objFile.WriteLine "</head>" objFile.WriteLine "<body>" objFile.WriteLine "<h1>SoftWare Report -- Date: " & Now() & _ "</h1>" & vbCrLf objFile.WriteLine "<table border=1>" 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 objFile.WriteLine "<tr>" objFile.WriteLine _ "<td>Installed Software....:</td><td>" & strvalue & "</td>" objFile.WriteLine "</tr>"
End If
Next objFile.WriteLine "<Font size=3 color=Red>_______________________________________张春良原创</font>" objFile.WriteLine "</body>" objFile.WriteLine "</html>" objFile.Close
|