INFO: Setting Environment Variables
Document ID: IR02020The information in this article applies to:
- Setup Factory 6.0
SUMMARY
This article explains how to set environment variables using Setup Factory 6.0.
DISCUSSION
Setting environment variables is done differently on Windows 9x operating systems (Windows 95, 95, ME) than it is on Windows NT operating systems (Windows NT 4.0, 2000, XP). This article will explain how to set environment variables on both types of operating systems.
Windows 9x
On Windows 9x operating systems, environment variables are set in the Autoexec.bat file, this file will be located on the root of the C:\ drive: "C:\Autoexec.bat"
In order to set an environment variable the following line must be inserted into the "Autoexec.bat" file:
SET EnvVariable=Value
Where "EnvVariable" is the name of the environment variable that you are setting, and "Value" is the value that will be assigned to the environment variable.
Use an Insert Text Line action to add this line to the "Autoexec.bat" file.
Windows NT
When a user logs on to Windows NT, the system obtains the initial set of environment strings by examining two keys in the registry.
The two keys are:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Environment
- HKEY_CURRENT_USER\Environment
System Variables (environment variables available to all users of thesystem) are set in: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Environment".
User variables (environment variables available to only the current user)are set in: "HKEY_CURRENT_USER\Environment".
In order to set an environment variable in Windows NT you need to create a registry value in one of those two registry keys. The name of the Registry value will be the name of the environment variable, and the value of the Registry value will be the value that will be assigned to the environment variable.
Use a Modify Registry action to set your environment variable in the registry.
NOTE: When setting variables like this on Windows 9x or Windows NT, the system MUST be restarted for them to take effect.
MORE INFORMATION
For more information please visit the following sources:
KEYWORDS: Setup Factory 6.0, Environment variables, Registry, Autoexec.bat
Last reviewed: October 21, 2002
Copyright © 2002 Indigo Rose Corporation. All rights reserved.