|ARM Technical Support Knowledge Articles|
Applies to: General Topics
Information in this article applies to:
What are environment variables and why do I need to be concerned with them? How do I tell DOS/Windows what I want my "Environment Variables" to be?
An "environment variable" is used to set-up certain features and parameters within which DOS and Windows applications can operate. If you go to your DOS prompt and type the word "set" (no quotes) and press enter you should get some text similar to that below:
Microsoft(R) Windows 95 (C)Copyright Microsoft Corp 1981-1996. C:WINDOWS>set PROMPT=$p$g winbootdir=C:WINDOWS COMSPEC=C:WINDOWSCOMMAND.COM PATH=C:PROGRA~1NORTON~1;C:WINDOWS; C:WINDOWSCOMMAND;C:TEMP=D:TEMP TMP=D:TEMP windir=C:WINDOWS BLASTER=A220 I5 D1 C:WINDOWS>
These settings tell DOS and your software where certain things are located in the system. Looking at the variable "COMSPEC" we see that it is set to equal (pointed to) "C:WINDOWSCOMMAND.COM". Whenever you return from a process or launch a process in which the COMMAND interpreter must be reloaded, this is the place the system looks first.
Note the two variables "TEMP" and "TMP". During operation, many programs create temporary files for various reasons. These variables tell the programs where the default location of these temporary files is to be located. You may assign these variables to point at ANY folder, however there are a few caveats:
"Environment Variables" are generally assigned in two particular system files: AUTOEXEC.BAT and CONFIG.SYS.
The CONFIG.SYS file is similar to the DIP switches found on older printers. This file contains specific instructions that are only loaded during boot-up. While Windows 95 may have no CONFIG.SYS file listed, or may have one that is empty, many of the files functions are built-in to the system and can be over-ridden in your CONFIG.SYS. The Keil tools make no modifications to your CONFIG.SYS file and so we will not discuss it further. An example of a Windows 95 CONFIG.SYS file is shown below: (Note: many commands are remarked-out, these can be un-remarked to allow booting the system when Windows 95 malfunctions.)
rem DEVICE=C:WINDOWSHIMEM.SYS rem DEVICE=C:WINDOWSEMM386.EXE NOEMS rem DOS=HIGH,UMB FILES=120 DEVICEHIGH=C:WINDOWSSETVER.EXE rem DEVICEHIGH=c:CDROMIBMTPCD.SYS /R
The AUTOEXEC.BAT file is a special type of command batch file. A batch file's purpose, and limitation, is to collect routinely utilized commands (to launch a program typically) into a script which can be invoked with a single command. Here is where the variables specific to the Keil tools are included in the system environment. Below is a copy of an AUTOEXEC.BAT with some commands commented-out. Keil tools are primarily interested in only three line items: those with the word "SET".
@ECHO OFF rem C:WINDOWS et start rem C:WINDOWSCOMMANDMSCDEX.EXE /D:TPCD001 /M:15 SET PATH=C:PROGRA~1NORTON~1;C:WINDOWS; C:WINDOWSCOMMAND;c: SET TEMP=d:TEMP SET TMP=d: emp
Article last edited on: 2005-08-08 09:38:30
Did you find this article helpful? Yes No
How can we improve this article?