1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/windows/setx.md
2021-10-04 16:46:26 -03:00

20 lines
571 B
Markdown

# setx
> Sets persistent environment variables.
> More information: <https://docs.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}}`