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:\batch
path display change
Change Path Permanently (Win 7 and 10)
Using the example above, do the following
to append the folder to Path variable permanently:
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