Cuzfu,

Your script runs in loop that never stops and only finds the first key.
I put together a script that might be helpful in your case. Be aware that I did not test the script and it needs to be changed to the proper keys it should check. I used the Office 2003 key just as an example.

Something like this might work for you.

Code:

;Break on gives the ability to end the script and not get logged off.
Break on
;
;Set the required version.
$Version = "10.19"
;
;Open the logfile, if it does not exist create it.
$rc = Open (1, "c:\log.txt", 5)
;
;This is the key for MS Office 2003 Pro.
$key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
$app = "{90110409-6000-11D3-8CFE-0150048383C9}"
;
;Check if the app is installed.
$keyexists = KeyExist($key + $app)
If $keyexists <> "0"
;Find the displayname and the display version.
$dispname = ReadValue($key + $app, "Displayname")
$dispversion = ReadValue($key + $app, "Displayversion")
;Write name and version to the logfile.
WriteLine(1, "Application: " + $dispname + " version: " + $dispversion + " is installed." + @CRLF)
$version is SubStr($version, 1, 5)
If $version <> "10.19"
WriteLine(1, "Application: " + $dispname + " update required." + @CRLF)
;Start upadte
Run "pathtoupdatefile\update.exe"
Else
WriteLine(1, "Application: " + $dispname + " update NOT required." + @CRLF)
EndIf
Else
WriteLine(1, "Application: " + $app + " is NOT installed." + @CRLF)
EndIf
;
;Close the logfile.
$rc = Close(1)



Edited by Mart (2006-03-28 09:13 AM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.