Why does the setx path not work?

can anyone explain this result? After setting the path, it has not changed. This was done on the admin command line:

C:\Windows\system32>setx path "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin"

SUCCESS: The indicated value has been saved.

C:\Windows\system32>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin;D:\Program Files (x86)\metapad36;D:\Program Files (x86)\metapad36" /M

I read that the variable% PATH% = PATH for the variable machine + PATH for the user. I see the path to the machine + the path of the administrator?

reviewed other articles on this topic but are still confused.

Should I clear user paths, so no duplication?

update : return that "the variables created or modified by this tool will be available in future command windows", I will open the non-admin window and enter:

>path PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin;;D:\Program Files (x86)\metapad36;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin

The path is repeated twice. Ok, then with the same prompt, I setx the path without repetition and without /M:

`>setx path "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin"

SUCCESS: The indicated value has been saved.

, .

new -admin :

>path PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin;;D:\Program Files (x86)\metapad36;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;D:\Program Files (x86)\Microsoft VS Code\bin

. ?

+4
1

Windows , . .

, setx ( , /M), , setx, cmd.exe. setx, cmd.exe.

setx /?:

, , , CMD.exe.

, , setx, set.

+9

Source: https://habr.com/ru/post/1628366/


All Articles