I am not quite sure how to do that since it is building a record. The code is posted below in case you want to modify it. Just change the MDB file name and create a table called inventory with the four fields: quote:
"computername"
"program"
"date"
"time"
code:
$DBpath = "c:\data\users\default\db1.mdb"
$CNstring = "provider=microsoft.jet.oledb.4.0;data source=$DBpath;persist security info=false"
$CMDtxt = "select * from Inventory"
$cn = CreateObject ("ADODB.Connection")
$cmd = CreateObject ("ADODB.Command")
$rs = CreateObject ("ADODB.RecordSet")
$cn.connectionstring = $CNstring
$cn.Open
$cmd.activeconnection = $cn
$rs.cursortype = 3
$rs.locktype = 3
$rs.activecommand = $cmd
$cmd.commandtext = $CMDtxt
$rs.Open ($cmd)
Function GetUninstallInfo()
Dim $Index, $Key, $RC, $Value, $RootKey
Dim $progs[0]
$Index = 0
$RootKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
$Key = EnumKey($RootKey, $Index)
While @Error = 0
ReDim PRESERVE $progs[$Index]
$RC = EnumValue($RootKey + $Key, 1)
If @Error = 0
$Value = ReadValue($RootKey + $Key, "DisplayName")
If $Value = ""
$Value = ReadValue($RootKey + $Key, "QuietDisplayName")
If $Value = ""
$Value = $Key
EndIf
EndIf
Else
$Value = $Key
EndIf
$progs[$Index] = $Value
$Index = $Index + 1
$Key = EnumKey($RootKey, $Index)
Loop
$GetUninstallInfo = $progs
EndFunction
$array = GetUninstallInfo()
$i=0
For Each $item in $array
$rs.addnew
$rs.fields.item("computername") = @WKSTA
$rs.fields.item("program") = $item
$rs.fields.item("date").value = @DATE
$rs.fields.item("time").value = @TIME
$rs.update
? "$i: $item"
$i = $i +1
Next
$rs.Close
Return
:END