Win Path environment variable

Win Path environment variable

The Path variable holds the names of folders that are searched if the file being executed is not in the default folder at the command prompt. For example, if all the batch files are in C:\BATCH, and c:\batch is added to the Path environment variable, that batch file can be run from any command prompt.

Change Path This Time Only

Using the C:\BATCH example, to set the path for this session only, use the Set command. The %PATH% means the path variable as it currently exists. Note the two percent signs and semicolon. See cmd abc's.
path          display current path

  set path = %path%;c:\batchpath          display change

Change Path Permanently

Using the C:\BATCH example, to append the folder to the Path variable permanently, do the following:

Windows 7, 8.1 and 10
1. System control panel
2. Advanced System Settings/Advanced Tab
3. Click Environment Variables
4. In System variables, scroll down to Path
5. Click Path and then Edit
6. Add ;c:\batch to the end of line
7. Click OK several times to exit
8. Restart computer to take effect
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.