1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-03-28 21:16:20 +01:00
tldr/pages/windows/setx.md
Lena c9775847b6
pages/*: use the imperative in descriptions (#12574)
* pages/*: use the imperative in descriptions

* go-fmt: put the description on one line
2024-04-18 09:34:00 +05:30

571 B

setx

Set persistent environment variables. More information: https://learn.microsoft.com/windows-server/administration/windows-commands/setx.

  • Set an environment variable for the current user:

setx {{variable}} {{value}}

  • Set an environment variable for the current machine:

setx {{variable}} {{value}} /M

  • Set an environment variable for a user on a remote machine:

setx /s {{hostname}} /u {{username}} /p {{password}} {{variable}} {{value}}

  • Set an environment variable from a registry key value:

setx {{variable}} /k {{registry\key\path}}