I am trying to collect info from our wks about which Trend micro server they are running against. Depending on the version of the application they are running they could have different HKLM entries.

I am able to query the registry and pull the info out of the registry, my issue is about checking to see which registry path is valid. I am trying to run using IF statements but it is not working. the test machine just reports that Trend is not installed

Any help would be apprec.

 Code:
If Open (1,"\\tomato\OPENSHARE\LogonScript\Results\Trendmicro\trendmicro" + @year + @monthno + @mdayno + ".txt",5) = 0
	If (ReadValue("HKey_Local_Machine\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\","Server")) = 0
		$x = writeline (1, @hostname +"," + ReadValue("HKey_Local_Machine\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\","Server") + @CRLF)
	Else
		If (ReadValue("HKey_Local_Machine\SOFTWARE\TrendMicro\PC-cillin\14\VA\","server")) = 0
			$x = writeline (1, @hostname +"," + ReadValue("HKey_Local_Machine\SOFTWARE\TrendMicro\PC-cillin\14\VA\","Server") + @CRLF)
		Else
			$x = writeline (1, @hostname + ", No Trend detected" + @CRLF)
		EndIf
	EndIf
EndIf
Close (1) 

jeff