Forrest logo
tool overview
On this page you find all important commands for the CLI tool setx. If the command you are looking for is missing please ask our AI.

setx

setx is a command-line tool in Microsoft Windows used to set environment variables permanently. It allows users to modify, create, or delete environment variables from the command prompt or batch files. The setx command replaces the older set command and has more advanced features. With setx, users can set both system-wide and user-specific environment variables. The command syntax includes the variable name, the value to assign to the variable, and an optional parameter to specify whether the variable should be set in the user or system environment. By default, setx sets the variable in the user environment unless specified otherwise. Additionally, setx can read from a file and set the variable value accordingly, making it convenient for automated configurations.

List of commands for setx:

  • setx:tldr:3a8d0 setx: Set an environment variable from a registry key value.
    $ setx ${variable} /k ${registry\key\path}
    try on your machine
    explain this command
  • setx:tldr:76f43 setx: Set an environment variable for the current user.
    $ setx ${variable} ${value}
    try on your machine
    explain this command
  • setx:tldr:781ed setx: Set an environment variable for a user on a remote machine.
    $ setx /s ${hostname} /u ${username} /p ${password} ${variable} ${value}
    try on your machine
    explain this command
  • setx:tldr:f169d setx: Set an environment variable for the current machine.
    $ setx ${variable} ${value} /M
    try on your machine
    explain this command
tool overview