Env_SetString
Description
Section titled “Description”Sets value of specified environment variable. The value is written to the registry: HKLM\System\CurrentControlSet\Control\Session Manager\Environment for system variables, and HKCU\Environment for user variables. A value that contains % is stored as an expandable string.
Programs that are already running don’t see the new value.
Syntax
Section titled “Syntax”Env_SetString(sName, sValue, sType) As Boolean
Parameters
Section titled “Parameters”sName (String)
Section titled “sName (String)”Environment variable name
sValue (String)
Section titled “sValue (String)”Environment variable value
sType (String)
Section titled “sType (String)”Environment variable type: ‘System’ or ‘User’. Any other value, including ‘Process’, sets a system variable. In computer jobs, ‘User’ sets the variable for the account that runs the job.
Return value
Section titled “Return value”Boolean, TRUE if function completed successfully.
Example
Section titled “Example”If bStatus Then bStatus = Env_SetString("TEST", "C:\MyFiles", "SYSTEM")