thanks for the comments...
doc,
I need you to run this against the system had a minor problem with diskdriveinfo().
change that function here and wanna know if the info is correct 100% now, k?
btw, fixed a problem with the original code when the value part had only one array element of arrays not displaying properly.
Code:
$hd="DiskDrives",diskdriveinfo
$OS="OS",split("Name"+chr(1)+"Windows 2000"+chr(2)+"Service Pack"+chr(1)+"4"+chr(2)+"Role"+chr(1)+"workstation"+chr(2)+"language"+chr(1)+"finnish",chr(2))
$Antivir="Antivirus",split("Name"+chr(1)+"Fsecure AV"+chr(2)+"version"+chr(1)+"5.52"+chr(2)+"defTimeStamp"+chr(1)+"23.10.2004_03",chr(2))
$proggies=proggielist(".")
$Hardware="Hardware",$hd
$software="Software",$os,$antivir,$proggies[0],$proggies[1]
$header=@wksta,$hardware,$software
;$=open(1,@scriptdir+'\testoutput2.htm',5)
;writeline(1,buildHTMLtree($header))
;$=close(1)
;run 'explorer "'+@scriptdir+'\testoutput2.htm"'
$ie = CreateObject("internetexplorer.application")
; $ie.fullscreen = 1
$ie.menubar = 1
$ie.statusbar = 0
; $ie.toolbar = 1
$ie.navigate("about:blank")
While $ie.busy AND $ie.readystate <> 4 AND @error = 0 Loop
$ie.document.write('<span style="position:absolute;right:10;cursor:pointer;" onclick="window.close()">Close</span>')
$ie.document.write(buildHTMLtree($header,1))
; $ie.document.body.background = @scriptdir+"\warn.jpg"
$ie.visible = 1
function buildHTMLtree($data, optional $forceWrap)
if 8<>vartype($data[0]) exit 1 endif
$buildHTMLtree='<span style="cursor:pointer;" id="s_' + $data[0] + '" onclick="var sauna = document.getElementById('
+"'"+$data[0]+"'"+"); var s2 = document.getElementById('s_"+$data[0]+"'); if (sauna.style.display == 'none')"
+" { sauna.style.display = 'block'; s2.innerHTML='<font face=Wingdings>1</font> <b>"+ $data[0]
+"</b>'; } else { sauna.style.display = 'none'; " +"s2.innerHTML='<font face=Wingdings>0</font> <b>"
+ $data[0] + "</b>';}" + '"><font face=Wingdings>0</font> <b>' + $data[0] + '</b></span><table id="'
+ $data[0] + '" style="display:none;"><tr><td width="20"> </td><td>'
$hc=0
for $section=1 to ubound($data)
if 0<ubound($data[$section])
if 8<>vartype($data[$section][1])
$buildHTMLtree=$buildHTMLtree+BuildHTMLtree($data[$section])
$hc=1
endif
endif
if $hc=0
$buildHTMLtree=$buildHTMLtree+'<table><tr><td width="20"></td><td><table bgcolor="#EEEEEE">'
$bg=0
for $value=0 to ubound($data[$section])
$bg=$bg+1
$=split($data[$section][$value],chr(1))
$buildHTMLtree=$buildHTMLtree+'<tr '+iif($bg/2*2=$bg,'bgcolor="#FFFFFF"','')+'><td></td>'
for each $s in $ $buildHTMLtree=$buildHTMLtree+'<td>'+$s+'</td>' next
$buildHTMLtree=$buildHTMLtree+'</tr>'
next
$buildHTMLtree=$buildHTMLtree+'</table></td></tr></table>'
endif
next
$buildHTMLtree=$buildHTMLtree+'</td></tr></table><br>'
endfunction
Function proggieList($C)
Dim $S,$L,$SL,$PL
For Each $S In GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$C+'\root\cimv2' ).ExecQuery('select * from Win32_Service', , 48)
$SL = $SL+chr(2)+$S.Name+chr(1)+$S.DisplayName+chr(1)+$S.PathName+chr(1)+$S.StartMode+chr(1)+$S.State+chr(1)+$S.StartName
Next
For Each $P In GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$C).ExecQuery('select * from Win32_Process')
If $P.ExecutablePath = '' $P.ExecutablePath = 'Path Unknown' EndIf
$PL = $PL+chr(2)+$P.Name+chr(1)+$P.ProcessId+chr(1)+$P.ExecutablePath
Next
$PL="Processes",split(substr($PL,2),chr(2))
$SL="Services",split(substr($SL,2),chr(2))
$proggielist=$SL,$PL
EndFunction
Function DiskDriveInfo(optional $C)
Dim $D,$DL,$Size,$
if not $C $C = "." endif
For Each $D In GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$C+'\root\cimv2' ).ExecQuery('select * from Win32_DiskDrive', , 48)
$Size = (0.0+cint(""+((0.0+$D.Size) / 100000000)))/10
$DL = $DL + chr(2) + $D.Model + chr(1) + $D.interfacetype + chr(1) + $Size + 'GB'
Next
$DL = split(substr($DL,2),chr(2))
$DiskDriveInfo=$DL
EndFunction