I think you are missing something.
Have a look at the explanation below.

A cleaner version for your script would be like this:
 Code:
If Not KeyExist("Registry key to check goes here")
	$rc = WriteValue("Registry key", "Registry value", "Data", "Data Type")
Else
	Exit 0
EndIf


What Writevalue wants:
- Registry key: The "folders" in the left pane of regedit.
- Registry value: The entries in the right pane of regedit.
- Data: What should the registry value hold?
- Data type: Type of the registry value.

Data type can be:

REG_NONE
REG_SZ
REG_EXPAND_SZ
REG_BINARY
REG_DWORD
REG_DWORD_LITTLE_ENDIAN
REG_DWORD_BIG_ENDIAN
REG_LINK
REG_MULTI_SZ
REG_RESOURCE_LIST
REG_FULL_RESOURCE_DESCRIPTOR


Edited by Mart (2009-06-15 04:58 PM)
Edit Reason: Typo.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.