Ok , ive test this on a number of different pcs and it is not creating the regkey anyway in any hive (hkcu/hklm)

This was working , so can somebody try the following and see if it enters into your machines registry

WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\NewPrint\Factory4", "RegName", "GPE", "REG_SZ")