| Environment Variable |
Article Index for Environment |
Website Links For Environment |
Information AboutEnvironment Variable |
| CATEGORIES ABOUT ENVIRONMENT VARIABLE | |
| operating system technology | |
| configuration files | |
|
BACKGROUND In all Unix and Unix-like systems, each process has its own private set of environment Variable s. By default, when a process is created it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child. All Unix Operating System flavors as well as DOS and Microsoft Windows have environment variables; however, they do not all use the same variable names. Running programs can access the values of environment variables for configuration purposes. Examples of environment variables include #the PATH which lists directories the shell searches for commands the user may type. #HOME ( Unix-like ) and userprofile (Microsoft Windows) indicate where a user's Home Directory is located in the File System . #TERM ( Unix-like ) specifies the type of Computer Terminal or Terminal Emulator being used (e.g., Vt100 or ''' Dumb '''). #CVS_RSH ( Unix-like ) is used to tell CVS which Rsh -like program to use. #MAIL ( Unix-like ) is used to indicate where a user's mail is to be found. Shell Script s and batch files use environment variables to store temporary values for reference later in the script, and also to communicate data and preferences to child processes. In Unix, an environment variable that is changed in a script or compiled program will only affect that process and possibly child processes. The parent process and any unrelated processes will not be affected. In Windows, environment variables are stored globally in the Windows Registry , and changes are seen by all processes that see the relevant registry changes. The variables can be used both in scripts and on the Command Line . They are usually referenced by putting special symbols in front of or around the variable name. For instance, to display the program search path on a DOS or Windows system, the user could type in this command: :echo %PATH% In the Bash shell for Unix (also available for Windows), either of the two commands below could be used: :echo :echo Other scripting and shell environments sometimes use other symbols for the same purpose. To show all the variables that are set in a prompt (DOS-WINDOWS) use: :SET The Unix equivalent is: :env MICROSOFT WINDOWS %AppData% Contains the full path to the Application Data folder of the user logged in. %SystemDrive% The %SystemDrive% variable is a special system-wide environment variable found on Microsoft Windows NT and its derivatives. Its value is the drive upon which the system folder was placed. The value of %SystemDrive% is in most cases C:. The system drive cannot be altered once the operating system is running. %SystemRoot% The %SystemRoot% variable is a special system-wide environment variable found on Microsoft Windows NT and its derivatives. Its value is the location of the system folder, including the drive and path. The drive is the same as %SystemDrive% and the path depends upon the version and circumstances of the operating system. By default,
The %SystemRoot% may be different if the system was upgraded from earlier version of Windows NT, or from Windows 3.1 , Windows 95 , Windows 98 , or Windows Me . %UserProfile% The %UserProfile% variable is a special system-wide environment variable found on Microsoft Windows NT and its derivatives. Its value is the location of the current user's profile directory, in which is found that user's HKCU registry hive (NTUSER). %WinDir% This variable points to the Windows directory. If the System is on drive c: then the default values are:
%ProgramFiles% This variable points to Program Files directory, which stores all the installed program of Windows and others. The default is C:\Program Files. Other environment variables EXTERNAL LINKS
|
|
|