JSI Tip 4928. SETENV.EXE is a freeware replacement for SETX.EXE, and it has more functionality.

"SETENV.EXE (for NT, Intel) offers greater functionality than the ResKit's command-line utility SETX.EXE in viewing and manipulating the WindowsNT "master" environments. By accessing either "HKEY_CURRENT_USER\Environment" or "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ("user" or "machine" environment) SETENV will display an entire environment or the value of a single variable, set or change the value of a single variable, or delete a variable. \[*New: support (-v) for the "volatile" environment; see below.\] Upon successfully making changes to an environment, SETENV calls "RegFlushKey" to ensure that the changes are written to disk immediately, and then calls "BroadcastSystemMessage" to inform all (interested) components that a change to the environment has been made. EXPLORER (and not many other programs) acts on this message by updating its environment. "BroadcastSystemMessage" is an improvement over "SendMessageTimeout" which is apparently used by SETX as well as the MyComputer\Properties\Environment page; "SendMessageTimeout" can fail if EXPLORER is running as a separate process from the TaskBar/Desktop (see the Knowledge Base's Q104011) and, at the moment, has no windows open to process the message. SETENV's syntax message (which will be displayed if an otherwise invalid syntax is used) appears below. Get SETENV.EXE by anonymous FTP."

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.