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. An alternate form omits the "equals" sign. 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. Any file that is in a directory listed in the PATH variable can be found or opened by direct reference to the name of the file without having to specify the drive and directories where it is located.
This is very handy in scripting and in other ways. For instance, the name of an executable file that is in a directory listed in the PATH variable can be entered into Start-Run to open certain applications more on this subject here.
The file is sol. Normally this entire string would have to be used in order to reference the Solitaire game. Because its directory is listed in the PATH variable, however, it is sufficient to reference just the file name sol. As is explained on other pages , file extensions tell Windows what it is supposed to do with a file.
Certain file extensions indicate that the file is executable ; that is, the file opens a program or does something. The extension. EXE is the most common. Thus the filename sol. If files have the same name but different extensions, the operating system searches in the following order of precedence:. BAT, and. Existing variables can be edited or deleted and new ones can be added in several ways.
For temporary changes, the command " Set" can be used in scripts or in a command window. Note that the there must be no spaces on either side of the "equals" sign.
Changes made with "Set" disappear when the command window is closed, thus rendering this method fairly uninteresting for the average PC user. A more useful application of "Set" is to list the environment variables. Open a command window and enter "set" to see what the variables are on your system.
I'm not on Windows to test. Anyway, maybe it helps you. There's also ver which looks built-in - here's an example script using that. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 11 years, 8 months ago. Active 4 years, 4 months ago. Viewed 23k times. It is not defined in XP. Is there anyway i could do this? Santhosh Santhosh 6, 15 15 gold badges 54 54 silver badges 61 61 bronze badges.
Possible dupe - stackoverflow. ChrisF, that question actually talks about detecting the Windows version by any available means mostly by APIs. Not necessarily System Environment Variables. Which is why I just commented rather than voting to close. Do any of the answers help at all? To see a complete list of the environment variables that are active on a Windows XP system, follow these steps:. You'll see a list of the current environment variable settings. Here's a sampling of Windows XP's environment variables:.
Automatically sign up today! Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry. To see a complete list of the environment variables that are active on a Windows XP system, follow these steps: Open a Command Prompt window. Type Set and press [Enter]. CD: Lists the current directory string.
0コメント