Support
10-10-2002, 01:07 PM
<HTML><HEAD><TITLE>INFO: Setting Environment Variables</TITLE></HEAD><BODY><h3>INFO: Setting Environment Variables </h3><b>Document ID: IR02020</b><hr>The information in this article applies to:<ul><li>Setup Factory 6.0</li></ul><hr><h3>SUMMARY</h3><p>This article explains how to set environment variables using Setup Factory 6.0.</p><h3>DISCUSSION</h3><p>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.</p><p><b>Windows 9x</b></p><p>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"</p><p>In order to set an environment variable the following line must be inserted into the "Autoexec.bat" file:</p><pre><code>SET EnvVariable=Value</code></pre><p>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.</p><p>Use an <b>Insert Text Line</b> action to add this line to the "Autoexec.bat" file.</p><p><b>Windows NT</b></p><p>When a user logs on to Windows NT, the system obtains the initial set of environment strings by examining two keys in the registry.</p><p>The two keys are:</p><ul><li>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Environment</li> <li>HKEY_CURRENT_USER\Environment</li></ul><p>System Variables (environment variables available to all users of thesystem) are set in: "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Session Manager\Environment".</p><p>User variables (environment variables available to only the current user)are set in: "HKEY_CURRENT_USER\Environment".</p><p>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.</p><p>Use a <b>Modify Registry</b> action to set your environment variable in the registry.</p><p><b>NOTE:</b> When setting variables like this on Windows 9x or Windows NT, the system <b>MUST</b> be restarted for them to take effect.</p><h3>MORE INFORMATION</h3><p>For more information please visit the following sources:</p><li><A HREF="http://support.microsoft.com/support/kb/articles/q100/8/43.asp" target="blank">Microsoft Knowledge Base Article - Q100843 Environment Variables in Windows NT</a></li><li><A HREF="http://www.winntmag.com/Articles/Index.cfm?ArticleID=5379" target="blank">www.winntmag.com - Managing NT Environment Variables</a></li><li>The topic <b>Command Reference | Actions | Individual Actions | Insert Text Line</b> in the Setup Factory 6.0 help file.</li><li>The topic <b>Command Reference | Actions | Individual Actions | Modify Registry</b> in the Setup Factory 6.0 help file.</li><p>KEYWORDS: Setup Factory 6.0, Environment variables, Registry, Autoexec.bat</p><hr><FONT SIZE=1>Last reviewed: October 21, 2002<br>Copyright © 2002 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br></FONT></BODY></HTML>