Similar question to How to keep from duplicating path variable in csh and How to keep from duplicating path variable in ksh. But this time using Windows command line (cmd.exe
).
PATH=C:\path\to\bin;%PATH%
How do I remove duplicates from PATH
? It would like to do this in an automated way: as part of our build process a specific path is added to the environment variable PATH
; when done 20+ times that path is present 20+ times. I want to avoid that.