Page 2 of 2 <12
Topic Options
#102764 - 2003-07-11 10:11 AM Re: Running a command from kix...
NTDOC Administrator Offline
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
#102765 - 2003-07-11 10:16 AM Re: Running a command from kix...
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and like you see, it's not wmi but kix [Big Grin]
_________________________
!

download KiXnet

Top
#102766 - 2003-07-11 10:22 AM Re: Running a command from kix...
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Here are the links to where this stuff came from.

Lonkero, Shawn, and Bryce were very helpful with getting these scripts completed. I really love the help this board's members provide. Great bunch of guys. [Big Grin]

There is still room for improvement in them as I learn more and more about scripting, unfortunately not enough time to bring all my old code up to snuff.

http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=003989

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=003795

Top
#102767 - 2003-07-11 10:44 AM Re: Running a command from kix...
RichardG_dup1 Offline
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. [Smile]
Top
#102768 - 2003-07-14 02:16 AM Re: Running a command from kix...
RichardG_dup1 Offline
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
Page 2 of 2 <12


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 905 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.057 seconds in which 0.028 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org