When i try to add PATH variable existing path variables are duplicating.

Below command I am using to add the system variables permanently.

reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /d "%PATH%;C:\BuildTools;

Here existing path variables duplicating, after that new one is appending.

any solution to avoid this?

Thank you!

link|improve this question
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.