mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-31 05:41:49 +00:00
26 lines
665 B
Plaintext
26 lines
665 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, windows]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# 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}}`
|