Where should the trailing semicolon in the Windows PATH environment variable be placed when adding a new folder?
Is it
?
I saw different practices.
This is not really a syntax thing, actually. The correct answer here is: Place the semicolon so the result is a valid PATH
.
This usually means one of the following:
set PATH=%PATH%;C:\Foo\Bar
set PATH=C:\Foo\Bar;%PATH%
because usually PATH
doesn't end in a semicolon, so you have to add one appropriately to not mangle an existing path in it.
Just look at how PATH
looks like and consider what you need to do if you add another path. This means you have to add a separator (the semicolon) and the path itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With