Skip to content

Reg_SetExpandString

Sets the value of a registry variable of type expandable string (REG_EXPAND_SZ). If the key doesn’t exist, it’s created.

The value is written as it is: environment variables such as %temp% aren’t expanded.

Reg_SetExpandString(sHandle, sKey, sVariable, sValue) as Boolean

Registry hive, for example HKLM. For all accepted values, see Registry Functions.

Subkey path

Name of variable to contain the value

Value

If bStatus Then bStatus = Reg_SetExpandString("HKLM", "Software\KeyName", "ValueName", "%temp%")

Scripting Guidelines

Registry Functions Constants Package Property Variables