What Im trying to do, is if the value '\\hoclewww01\oracle' exists in the registry name 'TNS_ADMIN' replace it with ''\\fladomain\dfsshares\oracle','REG_SZ'.

Here is my code in my kixtart script.

If ReadValue('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment','TNS_ADMIN','\\hoclewww01\oracle')
? "Found Value in HKCU..."
WriteValue('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment','TNS_ADMIN','\\fladomain\dfsshares\oracle','REG_SZ')
EndIf

I get an error...Does anyone know why Im recieving an error. Could use the help.