public bool isRegistryKeyExist(RegistryKey key,string subkeyName) { RegistryKey hkcr = key; bool exist; exist = hkcr.OpenSubKey(subkeyName) != null; hkcr.Close(); hkcr.Dispose(); return exist; }
import winreg def registryValid(key,subkey,var): try: hKey = winreg.OpenKey(key,subkey) value, type = winreg.QueryValueEx(hKey,var) res = True except: res = False return res