1

How would you add (not change) to the user PATH variable using setx?

I am trying the following:

setx PATH "%PATH%;C:\Users\bearc\Downloads\pathTesting"

But it only changes the whole path variable to the system path, then the path just added e.g pathTesting.

How would I add to this variable and not change it?

Eventually I will add this to my C# program but yeah.

Thanks, Henry.

1
  • I hope the linked post provides a solution, but the short of it is: avoid setx for updating the Path environment variable and, generally, any environment variables based on REG_EXPAND_SZ registry values. Commented Oct 2, 2021 at 22:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.