#102764 - 2003-07-11 10:11 AM
Re: Running a command from kix...
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11629
Loc: CA
|
Here, give this a try on your own workstation and let us know. Copy the code below and paste into Microsoft Word, then copy from Word and paste into a normal text editor and save as INVENTORY.KIX
Then in a DOS box run KIX32.EXE INVENTORY.KIX
code:
Break on $logsrv="CORPSUPPORT" $aStart=@ticks $outfile = "\\"+$logsrv+"\RAW$\software\@wksta.log" $software = combsort(getinstalledsoftware) If exist($outfile) del $outfile endif $nul = open(1, $outfile,5) $ = writeline(1,@Wksta+"*"+@FullName+"*"+@USERID+"*"+@IpAddress0+"*"+@PRODUCTTYPE+"*"+@CSD+"*"+@crlf) For each $item in $software $ = writeline(1,$item+@crlf) next $nul = close(1) $aStop=@ticks Return
function GetInstalledsoftware Dim $softwarekey, $index dim $temparray[10]
$SoftwareKey = enumkey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$Index)
while not @error $DisplayName = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$SoftwareKey","displayname") $DisplayVersion = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$SoftwareKey","DisplayVersion") if $DisplayName if $count > ubound($temparray) redim preserve $temparray[ubound($temparray)+10] endif $temparray[$count] = $DisplayName +" "+ $DisplayVersion $count = $count + 1 endif $Index = $Index + 1 $SoftwareKey = enumkey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$Index) loop if $count > 0 redim preserve $temparray[$count-1] else $temparray = "" endif $getinstalledsoftware = $temparray endfunction
Function CombSort($v, Optional $o) Dim $i,$j,$m,$s,$g $n=UBound($v) $g = $n If $g While $g > 1 Or Not $s $g=($g*1000)/1279 If $g < 1 $g = 1 EndIf $s=1 For $i = 0 To $n-$g $j=$i+$g If ($v[$i] > $v[$j] And Not $o) Or ($v[$i] < $v[$j] And $o) $m = $v[$i] $v[$i] = $v[$j] $v[$j] = $m $s=0 EndIf Next Loop $CombSort = $v Else $CombSort = 0 EndIf EndFunction
{edit} me cut the 2 lines a little to remove larger scrolling... {/edit} [ 11. July 2003, 10:55: Message edited by: Lonkero ]
|
|
Top
|
|
|
|
#102767 - 2003-07-11 10:44 AM
Re: Running a command from kix...
|
RichardG_dup1
Fresh Scripter
Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
|
I'll give it a go on monday and let you know. Thanks again.
|
|
Top
|
|
|
|
#102768 - 2003-07-14 02:16 AM
Re: Running a command from kix...
|
RichardG_dup1
Fresh Scripter
Registered: 2003-07-11
Posts: 16
Loc: Melbourne, Australia
|
Hi Guys,
Just thought I would close this discussion...
I ended up "run"ning a WKIX32.EXE script to go off and scan the local drive.
Thanks for your help. I will try and do the same for others next time I'm on.
Rich
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 918 anonymous users online.
|
|
|