I am new to registrykeyexists(root,key) method of Advapi32util which checks whether registry key "key"(key that is passed to registrykeyexists) is present in windows registry under the root.
Root that i am passing is "HKEY_LOCAL_MACHINE". Key is something that looks like "SOFTWARE\ABC\ABC DB"
And I see that this key is present in window's registry. ( by running "regedit" via cmd)
Below is the code snippet which does this work.
public static String getRegistryData(WinReg.HKEY root, String key, String value) {
System.out.println("Registry key exists status:" + Advapi32Util.registryKeyExists(root, key));
if (Advapi32Util.registryKeyExists(root, key)) {
String retVal = Advapi32Util.registryGetStringValue(root, key, value);
return retVal;
} else {
return null;
}
}
So,here when I debug, Advapi32Util.registryKeyExists(root, key) returns false.
Can anyone help me on this?? I would be grateful !!
Thanks In Advance.