After two days or butting my head aginst the monitor I turn to the Kix Guru's for help.Problem:
I have combined 2 seperate scripts trying to get the MS office version on a wrks from a text file of wrks names. It will run and create the desired text file but with the incorrect content (it lists the wrks name but the ver of MS office on the local wrks is listed for each wrks).
The code:
================================
Break on CLS
$input = "%0\..\wrksta.txt"
$output = "%0\..\msover.txt"IF OPEN(1,$input,2) = 0
IF OPEN(2,$output,5) = 0
ELSE
?" There is something wrong !!!"
GOTO END
ENDIF
$Wrksta = ReadLine(1)
WHILE @error = 0
IF @error = 0
$dir=readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe","Path")
if exist("$dir"+"\excel.exe")
$excel=getfileversion("$dir"+"\excel.exe")
select
case $excel=8.0a
$esr="97 SR-1"
case $excel=8.0e
$esr="97 SR-2"
case $excel=9.0.2719
$esr="2000"
case $excel=9.0.3822
$esr="2000 SR-1a"
endselect
$nul = WriteLine(2,$Wrksta + "MS Office Ver is " + $esr + chr(13) +chr(10))
endif
ELSE
$nul = WriteLine(2,$Wrksta + " Not online" + chr(13) +chr(10))
ENDIF
$Wrksta = ReadLine(1)
LOOP
ELSE
?"Wrksta.txt not available!"
EXIT
ENDIF
$nul = Close(2)
:END
$nul = Close(1)
EXIT
------------------