Help with adding to path in Win10 on a Surface

I simply cannot see how to add a new path in Win 10 on my Surface. Here are the sequence of steps I found by trial and error: From start menu,
Click on setting
Click on System
Click on About
Click on System info
Click on Advanced system settings
Click on Environment variables
Click on Path, then Edit
and a window opens that does not have the path. To be sure, it does have the last entry in the path, the one that was added when I installed TeX, but when I try to add to it, it just wipes that out and I am afraid to do anything with that since I am obviously flying blind.

If I open the settings and type path into the search box, it invites me to click on Edit environment variables and when I click on that I am taken to file explorer with no instructions. If I do that on a different Win 10 box, it puts me to the Environment variables screen as above. Can anyone help?

When you click on Edit, it should open a small window that says “Edit environment variable” at the top, a column of buttons on the right (New, Edit, Browse, etc), and a ruled pane on the left. The list of items in PATH should appear in the ruled pane, one per line. Is that not what you’re seeing? FWIW, on my system I only have one entry in the User PATH variable (%USERPROFILE%\AppData\Local\Microsoft\WindowsApps) although there are 5 entries in the System PATH.

You can add to the PATH using the CLI.

Run it elevated, and try:

setx path “%path%;C:\Your_New_Path”

Change the drive letter and path to the one you want, of course.

See if that works for you.

EDIT: I think, looking at the setx documentation, you need to add /m to make the change global.

It worked! I did
setx path %path%;c:\util
(util is a directory I keep a bunch of batch files that I run from the command line.) and reran path. No change. So I did setx /? and discovered that it has no effect in the current command file and so I exited and reran my command processor (which is call tcc and is a descendant of 4dos) and then the path was what I wanted. I had never heard of setx; it was news to me.

TSD scores again! Many thanks. Incidentally, I googled it before asking the question and found nothing really helpful. Instructions that didn’t work to click on things that didn’t exist.

IIRC it was added in Windows Vista. I don’t know if I’d call that “new” in 2017, but compared to the rest of the stuff in the Windows CLI it’s brand spankin’ new. :wink: