exception ERegistryException with message 'Invalid data type for 'Anykey''
This exception generally raises during reading a Window Registry key value in Delphi. This exception raises when Type of stored value in Windows register is different from the type that we used for reading the registry value in Delphi. We mostly get this error for Binary Type( rdBinary ) data. For this check if key values exists before do Read and check for data type too (if is compatible with ReadBinaryData)... ... if reg.ValueExists(Key) then if reg.GetDataType(Key) = rdBinary then Or You can do following rundown to solve this issue - Close you program - Open regedit - T hen Under File,click Export and keep a backup of systems registry - Under "Edit" Tab. Go to Find and type the Key - Delete the Key if found and continue till finish. - Then restart your program again and it should work. Or if the data type is REG_DWORD then try to read/write data using ReadInteger()/Write Integer() functions...