I have just tried to add something to my PATH and realized it grew out of proportions because of duplicates:
C:\Users\user>setx Path "%Path%;C:\Python34"
WARNING: The data being saved is truncated to 1024 characters.
SUCCESS: Specified value was saved.
When I printed the PATH value, I realized it was filled with duplicate entries (C:\Program Files\7-Zip even got in 3 times), so there's no place for new data. Is there a way to get rid of the duplicates without manual editing, and preferably without installing third-party software? Any advice on how to avoid PATH duplicates is welcome as well.
I have found a workaround already, but still it feels sub-optimal to have duplicates in PATH.