Hi Jeroen,

I think i find the problem:
Function ExistKey requires a subkey parameter and the complete path to "HKEY_LOCAL_MACHINE\Software\BdG\AMO\SoftwareDistribution" is a String value and then the results was always <>0!

The workaround is the Readvalue function, like the example:

code
_________________________________
? "Sto Inizializzando la chiave: " + $scKeyFull + "\" + $RegParameters[$Index]
$RegParamValue[$Index] = READVALUE ($scKeyFull,$RegParameters[$Index])
If @ERROR <> 0 ;if the value doesn't exist
$Value = ""
______________________
ecc......

I try to read the key value and if i can't i create.

Thanks

bye
Stefix