Did you verify that the key "HKEY_CURRENT_USER\Software\Linder\TestKey" existed before you attempted to WriteValue using this key?

My guess is that the key itself did not exist and that resulted in the error 2 File not found.

Use KeyExist() to see if you are processing a value key.

Use AddKey to create the TestKey before before writing to it.
_________________________
Home page: http://www.kixhelp.com/hb/