Set an environment variable for a user on a remote machine

setx

  • Sets persistent environment variables.
    More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/setx>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

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

click the source code to copy