Cracked it. Simple really... ret = RegSetValueEx(kh2, key_type, 0, REG_SZ, (CONST BYTE *) key, strlen(key) + 1); if(ret != ERROR_SUCCESS) { ret = RegSetValue(kh2, key_type, (CONST BYTE *) key, strlen(key) + 1); } Just use the older code if the newer code fails. Bit of a faf, but it works. ;P u6ik