Page 1 of 1 1
Topic Options
#188590 - 2008-07-07 07:36 PM Check for Registry Value
jcustance Offline
Just in Town

Registered: 2008-07-07
Posts: 2
Loc: canada
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

Top
#188591 - 2008-07-07 08:00 PM Re: Check for Registry Value [Re: jcustance]
jcustance Offline
Just in Town

Registered: 2008-07-07
Posts: 2
Loc: canada
I have found the KeyExist command, I am trying it out but I am currently seeing the same issue.
Top
#188595 - 2008-07-07 09:08 PM Re: Check for Registry Value [Re: jcustance]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
I would recommend not re-inventing the wheel.. There is enough talent around here a search yields good answers:

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Board=2&Number=175599

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.059 seconds in which 0.033 seconds were spent on a total of 13 queries. Zlib compression enabled.

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