win32api.RegSetValue

RegSetValue(key, subKey, type, value)

Associates a value with a specified key. Currently, only strings are supported.

Parameters

key : PyHKEY/int

An already open key, or any one of the following win32con constants:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

subKey : string

The name of the subkey with which the value is associated. This parameter can be None or empty, in which case the value will be added to the key identified by the key parameter.

type : int

Type of data. Must be win32con.REG_SZ

value : string

The value to associate with the key.

Comments

If the key specified by the lpszSubKey parameter does not exist, the RegSetValue function creates it.
Value lengths are limited by available memory. Long values (more than 2048 bytes) should be stored as files with the filenames stored in the configuration registry. This helps the registry perform efficiently.
The key identified by the key parameter must have been opened with KEY_SET_VALUE access.

Win32 API References

Search for RegSetValue at msdn, google or google groups.