For up to 6 people. Premium apps. Try 1 month free. Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help.
Can you help us improve? Resolved my issue. Environment variables are strings that contain information about the environment for the system, and the currently logged on user. Some software programs use the information to determine where to place files such as temporary files.
During installation, Windows XP Setup configures the default system variables, such as the path to the Windows files. You must be an administrator to modify a system environment variable. System environment variables are defined by Windows and apply to all computer users. Next, click the button "Environment Variables". The figure below shows the "Environment Variables" dialog box that opens next. It lists two kinds of variable- those that apply only to the current user and those that apply to the whole system.
You can simply scroll down the lists to see what is on your system or you can edit the lists. To create a new variable, use the "New" button.
There are also buttons for editing and for deleting variables. The box for adding a new user variable is shown below. Generally, this is likely to be a directory that you use frequently but can be any string of less than bytes. The maximum total size for all environment variables, including variable names and the "equals" sign, is characters. The next figure shows a box for editing a variable; in this case it is the PATH variable. Be sure to remember to separate directory names with a semicolon.
If you use programs in a particular directory a great deal, you may wish to add it to the path. It is not part of the standard Windows XP setup but a command-line tool called setx. This tool extends the set command so that permanent changes in the environment variables can be made. The "Set" command can be used in a command prompt together with a redirection to a text file to make a list of the current environment variables.
Microsoft also has a VBScript that lists environment variables on this page. For those who are experienced with editing the Registry, there is another way to make changes in environment variables. Editing the Registry is primarily for scripts used by systems administrators and is not recommended for the average PC user. The file autoexec. For the most part, Windows XP will ignore any autoexec. Although environment variables can be set in this way, there are probably better ways.
Search this site. The so-called predefined variables are generally unchanged during a login session but there are also some dynamic variables whose value may change. Some of these are listed in the next table. Environment variables are very convenient in scripts where certain standard directories and parameters need to be referenced but where the actual locations or names can vary from computer to computer.
Note that the presence of spaces in some names may necessitate the use of enclosing quotation marks around environment variables in scripts. By having a placeholder, no prior knowledge is required of such details as the exact location of Windows or who is logged in.
Some possibilities are explored in the following sections. The path to a file is basically its address on the computer. It tells programs how to find a file. It is the drive plus any directories and sub-directories where the file is located. Typically, this is a group of directories where executable files that are repeatedly used are to be found. Examples of the default values are listed in the first table above; in this case, they are the Windows directory and two of its important system sub-directories.
The PC user can also modify the contents using methods discussed further on. Adding directories to PATH can be very useful if you use scripts or the command line for system maintenance.
For example, it can be convenient to put the directory where you keep backups into the PATH variable. It can also be useful to modify PATH if you put programs in a directory different from the usual one. Note that the directory names are separated by a semicolon in the command statement.
This command will replace any previous directories that were in the PATH variable. It is essential to remember that any changes that are made in a command window only endure until the window is closed. For permanent changes, use the method discussed in another section. It is also possible to use the command-line executable setx.
0コメント