Page 1 of 1 1
Topic Options
#48999 - 2000-02-14 08:33 AM Detecting registry value
Anonymous
Unregistered


Is there any way of just determining whether a specific value exists? I mean without going through enumerating all the values in a key. Any assistance gratefully received.

Nick

Top
#49000 - 2000-02-16 07:41 PM Re: Detecting registry value
Anonymous
Unregistered


Sure, just try and read the value then look at the value of the return.

In this example user profiles are enabled when the value exists.. if a host hasn't turned on user profiles, the value simply does not exist:

$rtn = ReadValue("HKEY_LOCAL_MACHINE\Network\logon", "UserProfiles")

If $rtn = 1
"User profiles: enabled" ?
$user_profiles = "yes"

Else
"User profiles: disabled" ?
$user_profiles = "no"
Endif


------------------
K Torkelson
Sys Admin Analyst
ktorkelson@providentfunding.com


Top
#49001 - 2000-02-17 02:14 AM Re: Detecting registry value
Anonymous
Unregistered


Thanks very much, that's extremely useful

Nick

Top
Page 1 of 1 1


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

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

Generated in 0.05 seconds in which 0.022 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