#176491 - 2007-05-25 02:27 PM
Check for the existance of a registry value?
|
Jason W.
Fresh Scripter
Registered: 2003-05-19
Posts: 14
Loc: Orlando, FL
|
Is there a way to have Kixtart check for a specific registry value? I've seen the KEYEXIST command, but that just checks the registry keys. I need to have it check for a specific value under a key.
I want to use this in an IF statement.
Any help would be appreciated.
Thanks.
|
|
Top
|
|
|
|
#176492 - 2007-05-25 02:49 PM
Re: Check for the existance of a registry value?
[Re: Jason W.]
|
Benny69
Moderator
   
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
Hi Jason, I think you are looking for the 'ReadValue(SubKey,Entry)' function.
Example:
$CPUspeed = ReadValue ("HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0","~MHz")
$CPUspeed ?
|
|
Top
|
|
|
|
#176522 - 2007-05-26 11:22 PM
Re: Check for the existance of a registry value?
[Re: Jason W.]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
Well this would work but be careful as this method is NOT exact.
i.e. It will look for 2403 so values like 2405, 2406 etc would not be found and it would say so, but if you did not code otherwise and it only had 240 that would be found and valid as well.
Break On
If InStr(ReadValue('HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0','~MHz'),'2403')
'Value found' ?
Else
'Value not found' ?
EndIf
|
|
Top
|
|
|
|
#176551 - 2007-05-29 02:51 PM
Re: Check for the existance of a registry value?
[Re: NTDOC]
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|