CMD: Append to path without duplicating it?
- by Horst Walter
For one CMD session I can easily set a new path: SET PATH=%PATH%;"insert custom path here"
Doing so in a batch file does not consider whether the custom path is already included. How do I avoid duplicating it (i.e. check whether it is already contained in the PATH "string").
Remarks:
Related: How do I append user-defined environment variables to the system variable PATH in Windows 7?
Related: How can I permanently append an entry into the system's PATH variable, via command line?
Same question for UNIX: Add directory to $PATH if it's not already there