Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

valueExists

valueExists

Returns whether a value for the given key exists.

Method of

WinReg object

Syntax

boolean valueExists ( string key, string value );

Parameters

The method has the following parameters:

key
A string representing the path to the key.
value
A string representing the value being queried.

Returns

Boolean value: true if the key exists and the user has read access to it, otherwise false.

Example

winreg = getWinRegistry();
if ( winreg != null )
{
    winreg.setRootKey( winreg.HKEY_LOCAL_MACHINE);
    if(winreg.valueExists("SOFTWARE\\mozilla", "value name"))
    {
    //valueExists returned true
    } else {
    //valueExists returned false
    }
}

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh, Fredchat, Rod Whiteley
 Last updated by: Sheppy,